Menu

Different naming of field name at list and detail modes

2017-04-04
2017-04-04
  • Brian Cheong

    Brian Cheong - 2017-04-04

    Hi all,

    I want to have a different naming for the field name at list and detail mode. For instance, I have a property, named projectName2010. At detail mode, I want to name it as "Project Name" but at list mode, I want to name it as "Project Name (2010)". Is it possible to achieve these with openxava?

    Thanks.

    Brian

     
  • Shankar

    Shankar - 2017-04-04

    I think you should use the internatinalization file i18n_xx to define your lables for modules, fields,, associations, tabs etc. See URL below
    https://openxava.wikispaces.com/i18n_en#Internationalization (i18n)-Labels-Field Name

     
  • Brian Cheong

    Brian Cheong - 2017-04-04

    Hi Shankar,

    I did use the internationalization file to change the field name. But I want the field name on detail mode to be changed only. Is it possible to do so? I want to have two different field names for list and detail modes but they are under the same property.

     
  • Shankar

    Shankar - 2017-04-04

    Possible I think
    This is extract from the wiki page

    Specific module field names can be overridden like this:
    Classroom.location=Door Badge

    For associations, there is often a qualified field, which can be overridden like this:
    Project.currentManager.managerName=PM Name

    In List mode, qualified names are automatically qualified by OpenXava like this: Manager name of Current manager. If this is not desired, it can be overridden like this:

    Project.tab.properties.currentManager.managerName=PM Name

    for detail mode use Entity.fieldname= Your Field Name

    for list mode use Entity.tab.properties.fieldName=Your Property Name

    Please go through the wiki page

    Thanks

    Shankar

     
  • Brian Cheong

    Brian Cheong - 2017-04-05

    Hi Shankar,

    Thanks alot for the explanation on that part.

     
  • Brian Cheong

    Brian Cheong - 2017-04-07

    Hi Shankar,

    I have tried with the following code:

    Resident.tab.properties.numberOfMale=Number of Male
    

    for displaying at the list mode's table but not working at all. It displays the default field name "Number of male" instead.

    By the way, I can display "Number:" at the detail mode with the code:

    Resident.numberOfMale=Number:
    

    Please help me. Thanks.

    Brian

    ----------------------------------EDIT----------------------------------

    I think I found why the code is not working. It is due to I have my numberOfMale property under occupation{selfEmployed[student[numberOfMale,numberOfFemale, totalStudent]]}. Thus, what should be the correct format for Resident.tab.properties.numberOfMale=Number of Male?

     

    Last edit: Brian Cheong 2017-04-07
  • Brian Cheong

    Brian Cheong - 2017-04-10

    Still need help

     
  • Brian Cheong

    Brian Cheong - 2017-04-10

    Well, I got the solution. Instead of Resident., it should be villageInformation, which is having the collection view.

     

Log in to post a comment.