mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Final pieces of SVC 01: I18N List of values constraint following feedback from first sprint demo (ALF-8183)
All visible LIST constraints now have English labels, used existing translations for one constraint and updated JSF property sheet component to lookup display label. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28405 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -131,8 +131,8 @@ public class TextFieldGenerator extends BaseComponentGenerator
|
|||||||
UISelectItems itemsComponent = (UISelectItems)context.getApplication().
|
UISelectItems itemsComponent = (UISelectItems)context.getApplication().
|
||||||
createComponent("javax.faces.SelectItems");
|
createComponent("javax.faces.SelectItems");
|
||||||
|
|
||||||
List<SelectItem> items = new ArrayList<SelectItem>(3);
|
|
||||||
List<String> values = constraint.getAllowedValues();
|
List<String> values = constraint.getAllowedValues();
|
||||||
|
List<SelectItem> items = new ArrayList<SelectItem>(values.size());
|
||||||
for (String value : values)
|
for (String value : values)
|
||||||
{
|
{
|
||||||
Object obj = null;
|
Object obj = null;
|
||||||
@@ -159,7 +159,14 @@ public class TextFieldGenerator extends BaseComponentGenerator
|
|||||||
obj = value;
|
obj = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
items.add(new SelectItem(obj, value));
|
// retrieve the display label
|
||||||
|
String label = constraint.getDisplayLabel(value);
|
||||||
|
if (label == null)
|
||||||
|
{
|
||||||
|
label = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
items.add(new SelectItem(obj, label));
|
||||||
}
|
}
|
||||||
|
|
||||||
itemsComponent.setValue(items);
|
itemsComponent.setValue(items);
|
||||||
|
Reference in New Issue
Block a user