18.3.2.  Example 2: dynamic values (dropdown menu with predefined values)

If the data to enter is a choice instead of a free-text value, you can also define those in the descriptor like shown here:
    <!-- user interface components -->
        <ui-component name="interests">
                <value key="board">snowboarding</value>
                <value key="ski">skiing</value>
                <value key="sledge">sledging</value>
In portal-identity.sar/portal-identity.war/WEB-INF/jsf/common/profile.xhtml - change inputText to a selectOneMenu:
    <h:outputText value="#{bundle.IDENTITY_INTERESTS}"/>
    <h:selectOneMenu id="interests" value="#{manager.uiUser.attribute.interests}"
    <f:selectItems value="#{metadataservice.interests.values}" />
    <h:panelGroup />
    <h:message for="interests"/>
For localizing dynamic values it is also possible to use the resource bundle. This can be done by adding the key with a prefix (to i.e. Identity.properties) like in the following listing. The key will be stored in the users property and is used to identify the element. The value of the configuration file will only be used if no localization information is found.
IDENTITY_DYNAMIC_VALUE_BOARD=localized snowboarding


If the value is not required a blank element will be added at the top.