Back Forward Help: Localization
Manual Tasks: Update properties that use hard-coded drop-downs

PROJ-121 5.3 Your application may include hard-coded drop-down lists. For example, your application may include a property that allows users to select the type of business. The property is configured to use text entered as table values in a Local List. As an alternative, configure the property to reference (look up) field value rules.

First, you need to manually create a field value for each option that is to appear in the drop-down. Field values for translations are usually saved in @baseclass and a high-level RuleSet so they can be shared among multiple applications. However, if the field values for a drop-down are specific to a particular application or if there is chance that different applications may need different choices in the dropdown then you should create the field value in one of your application RuleSets and with one of your application classes (often the class group) as the Applies To class. The Field Name is usually the property that the dropdown is for and the Field Value is the value for the dropdown option. Enter the value that the user is to see in the dropdown in the Localized Label field and save the rule.

In the Property form, do the following:

  1. On the General tab, select PromptFieldValue in the HTML Property field. Set the two parameters named SortByLocalizeValue and DisableCache by clicking in the form.
    • When SortByLocalizedValue is true, the drop-down list displays the options in alphabetical order based on the localized value. When it is false, the options display in alphabetical order based on the last key of the field values (that is, sorted in the base language rather than the localized language). In most cases, set this to true.
    • Instead of alphabetical order, you may want to define a specific order for the options that is the same regardless of language.  For example, you can sort the options by low, medium, and high by setting the value to “false” and making the field value keys 1low, 2medium, and 3high.
    • Alternatively, you can create a custom HTML property rule for this property and not use PromptFieldValue. Your HTML property can define the HTML code for the drop-down list and use the JSP lookup directive to get the localized string for each option display value. Because you manually code each option tag, you can list them in any order you want.
    • When DisableCache “true,” the drop-down list is not cached locally at runtime, so it is regenerated every time it is referenced. This technique is useful if you have users who frequently switch locale without logging off.
  2. On the Table Edit tab, select Field Value as Type of Table. Enter the appropriate Class and Field Name values. Generally, the Class matches the class of the property and the Field Name matches the name of the property. However, if you use one list of options for multiple properties, these values may not match.

Remember to specify in step 6 that you want to include these existing base field values for your application RuleSets.

Related topics About Property rules
About Field Value rules

UpAbout the Localization wizard