Forum Stats

  • 3,840,184 Users
  • 2,262,573 Discussions


Dynamic labels for attributes in Entity object

Ravi4-Oracle Member Posts: 131 Employee
edited May 27, 2015 3:40PM in JDeveloper and ADF


I am trying to set the labels on the entity attributes by getting the value from Database. Here is a article I am referring  -

But this article is getting dynamic labels at the viewcontroller.

I want to do the same thing at the Model layer so that the labels are set on the entity object attribute (in the UI Hints tab) so that wherever this attribute is used the labels get reflected in all the pages.

I am not able to find how to use groovy expression or set the label dynamically on the entity attribute.

Can this be achieved ?

If anyone has tried it before or any pointers will be helpful.


JDev -


  • Ruben Rodriguez
    Ruben Rodriguez Member Posts: 351 Gold Badge
    edited May 23, 2015 7:25PM


    I have never done this in the model, but you could try to do the same but in the class call AM method getResourceBundle like this:

    getResourceBundle(String locale){

         String amDef = "";<br/>     String config = "the_configuration_name_to_use";<br/>     ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);<br/>     Map map = am.getResourceBundle(locale);<br/>     Configuration.releaseApplicationModule(am, false);

              return map;


    Then, in your entity.xml you should have this reference:


             <JavaResourceBundle MsgBundleClass=""/>


    and in the attribute something like this:






                 <LABEL ResId="LABEL_KEY_IN_DB"/>






  • Ravi4-Oracle
    Ravi4-Oracle Member Posts: 131 Employee
    edited May 27, 2015 3:40PM

    Hi Ruben,

    Thanks for the code. Will give it a try.

This discussion has been closed.