1 Reply Latest reply on Nov 23, 2008 12:59 PM by Sanne Grinovero

    selectOneMenu localization in Identity customization

    Sanne Grinovero Master

      Hi,
      I would like to customize the fields shown to users during the registration phase, as described at http://docs.jboss.com/jbportal/v2.7.0/referenceGuide/html_single/#identity_portlet_configuration_example2

      All logic is working ok, only I am not getting to I18: I've added several new properties in Identity.properties and they are picked up correctly for all InputTexts but not for the selectOneMenu.

      Actually I'm not 100% I understood the reference docs; this is what I've defined in identity-ui-configuration.xml:

      <ui-component name="typeofcustomer">
       <property-ref>portal.user.typeofcustomer</property-ref>
       <values>
       <value key="individual">individual</value>
       <value key="company">company</value>
       </values>
       <required>true</required>
      </ui-component>

      in register.xhtml:
      <h:panelGroup>
       <h:outputText value="#{bundle.IDENTITY_CUSTOMER_TYPE}" />
       <h:outputText value=" *" rendered="#{metadataservice.typeofcustomer.required}" />
       </h:panelGroup>
       <h:selectOneMenu id="typeofcustomer" value="#{manager.uiUser.attribute.typeofcustomer}"
       required="#{metadataservice.typeofcustomer.required}">
       <f:selectItems value="#{metadataservice.typeofcustomer.values}" />
       </h:selectOneMenu>

      And added this to Indentity.properties:
      IDENTITY_CUSTOMER_TYPE=Customer type
      IDENTITY_CUSTOMER_TYPE_INDIVIDUAL=X1
      IDENTITY_CUSTOMER_TYPE_COMPANY=X2


      I would expect to see a combobox containing "X1" and "X2" but I get "individual" and "company".

      My idea is that I'm failing to figure out how the property keys should be called;
      honestly the "skiing" example in the docs is cool and snowy :-P but from
      IDENTITY_DYNAMIC_VALUE_BOARD=localized snowboarding
      IDENTITY_DYNAMIC_VALUE_SKI=localized skiing
      I can't figure out how I should call the property exactly.

      Any hint please? this is Portal 2.7.0.GA.

        • 1. Re: selectOneMenu localization in Identity customization
          Sanne Grinovero Master

          mmm as usually I find the solution 5 minutes after posting on a forum..

          the solution was:

          IDENTITY_DYNAMIC_VALUE_INDIVIDUAL=X1
          IDENTITY_DYNAMIC_VALUE_COMPANY=X2


          I have to say that I was far from expecting the example in the docs to be taken literaly, please add some note to it ;-)

          Also this way I can't "scope" the translation of two keys of different components in a different way, not an hard problem but far from what I was expecting.