Unable to populate Label for Accessor using xliff/properties file - oracle-adf

I have a requirement ,where in I want to populate the label for an accessor from resource bundle ,but its not populating with the value for the key provided in the label .
The portal bundle has following entry:
CUST_ADD=Customer Address
and I'm using the below piece of code in the pagedef.xml to render Customer Address on the UI
<Accessors>
<Item Value="custAddList"
Label="#{adfBundle['PortalBundle']['CUST_ADD']}"/>
</Accessors>
But it is giving following error on UI :
STRINGMANAGER: Key: '#{adfBundle['PortalBundle']['CUST_ADD']}' not found in bundle 'oracle.javatools.resourcebundle.ResourceBundleRT'
Can any one tell me how do we populate this label from resource bundle.
Thanks,
Garima

use below command
{adfBundle['CUST_ADD']}
adfBundle needs to be registered name in resource bundle

I used : Label="#{adfBundle['portal.PortalBundle']['CUST_ADD']}"
we need to provide the absolute path of the portal bundle/properties file.

Related

Liferay 7.1 npm-react-module localization

I'm trying to include localization into my npm-react-module, but I have failed receiving the value for the corresponding key from the Langugage.properties file. It simply returns the key. I did some research but I couldn't find any source that would help me solve my problem.
In the code which I will show you bellow, I have included a Language.properties file into my module. In my portlet, I have included the needed configuration for the language properties. I have also tried to add a separate file for a specific locale, but that didn't help me either.
This is an example of my portlet configuration:
"javax.portlet.resource-bundle=content.Language"
This is an example content from my Language.properties file:
example-key=example-value
This is how I'm trying to access the value in my React Component:
<h1> {Liferay.Language.get('example-key')} </h1>
But it only returns "example-key" instead of "example-value".
In my view.jsp file I am able to retrieve the corresponding values using
<liferay-ui:message key='example-key'/>
I have tried this method: https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/localizing-your-portlet but it didn't work either. Did anyone get this to work properly in their npm-react-module? I really don't want to spend time implementing my own localization service. Thanks!
Liferay.Language.get('key') gets text replaced by the build mechanism. Therefore there is no actual object/class to do this. I have been trying to get this to work myself and have resolved that I will have to do internationalization on my own.
localizing is done only in build time meaning if you have a language
key that generated dynamicly , you can't localizate it or for example
if you get a key from api fetch and need to localizate it, you can't
beacuse Liferay localization method for react (
Liferay.Language.get("yourLanguageKey") ) its undefined in runtime and
you can't use it.
from: https://npm.io/package/liferay-react-runtime-localization

Is it possible to override BakeTasks in a plugin

I want Bake to add a custom TimestampBehavior to every table which has the fields created_at, modified_at, proved_at. I also want to remove the Validators for these fields.
Whether a model is added the TimestampBehavior is programmed in Bake/src/Shell/Task/ModelTask.php. I don't want to edit the file in the vendor folder, because my file might be overridden by an update.
Moving the file to my plugins folder doesn't work since i get the error message "class ModelTask is already defined".
Is it possible to extend the ModelTask somehow or to use a custom ModelTask.php in my plugins folder for bake to achieve my goal?
Thanks for your help!
Moving the file to my plugins folder doesn't work since i get the error message "class ModelTask is already defined".
It doesn't work because you probably haven't changed the namespace. Fix the namespace to the one the plugin uses and you're done. You can even extend classes of the same name by using uses Foo as Bar and then Foo extends Bar.

HelperProvider always open the index file

I want to build a context sensitive help for a winforms application, to do this I use a class with a reference to the HelperProvider component, HelpNamespace is set to the index html file and when a form is loaded I register each control in the form to the helperprovider with a topic that I get from a config file :
helpProvider.SetShowHelp(control, true);
helpProvider.SetHelpNavigator(control, helpNavigator);
helpProvider.SetHelpKeyword(control, helpKeyword);
when debugging I am sure that some controls are configured with some topics different from index file but when running and pressing F1 its always the index file (HelpNamespace) that is opened. When using a HelperProvider instance for each control and no single instance for all controls, that works fine!
Why I can't use a single instance of helperProvider for all controls?
You need SetHelpKeyword for each control. A HelpNavigator.TopicId may be useful for a CHM with topic ID's inside.
I'm missing ".Topic" in your code sample above. Try the code below or download a working example from:
http://www.help-info.de/files_download/CSharp2008_CHM.zip
// set F1 help topic for controls on this form
helpProvider1.SetHelpNavigator(this.btnStart, HelpNavigator.Topic);
helpProvider1.SetHelpKeyword(this.btnStart, #"/Garden/flowers.htm");
helpProvider1.SetHelpNavigator(this.btnExit, HelpNavigator.Topic);
helpProvider1.SetHelpKeyword(this.btnExit, #"/Garden/tree.htm");
helpProvider1.SetHelpNavigator(this.chkShowHelpWithNavigationPane, HelpNavigator.Topic);
helpProvider1.SetHelpKeyword(this.chkShowHelpWithNavigationPane, #"/HTMLHelp_Examples/jump_to_anchor.htm#AnchorSample");

Sort data on Data perspective (Composite C1)

I have created a custom datatype inside "Page Datafolders" on the "Data" perspective.
So, I have added this datafolder to a page and I am using it to show the data in the page with no problem...., but now I want to show this data sorted in admin console.
I tried to create a xml file inside of App_Data/Composite/TreeDefinitions without luck.
So, are there any tutorial to do this?
You are right to create a 'tree definition' xml file inside the ~/App_Data/Composite/TreeDefinitions folder, you should just ensure your definition has this bit:
<ElementStructure.AllowedAttachments ApplicationName="(your app name here)">
<DataType Type="Composite.Data.Types.IPage" Position="Bottom" />
</ElementStructure.AllowedAttachments>
Once you have this defined, you can attach it to a page using the 'Attach Application' command on it.
See http://docs.composite.net/Console/Guide-to-Applications/How-to-Attach-Console-Applications for details.

error in loading skin in dotnetnuke

I get this error when I load a page that uses a specific skin ,it was working very well befor .
Could Not Load Skin: /Portals/_default/Skins/MM-SubSites-Arb/inner.ascx Error: The ID 'dnnCOPYRIGHT' is already used by another control.
The error is telling you exactly what to look for: there is more than one control in the inner.ascx file that has an ID attribute of "dnnCOPYRIGHT."
Open the file in a text editor and do a search for "dnnCOPYRIGHT" to find the elements with that ID, and delete all but one of them.

Resources