Skip to content

Instantly share code, notes, and snippets.

@lincolnthree
Created April 11, 2013 16:28
Show Gist options
  • Select an option

  • Save lincolnthree/5364900 to your computer and use it in GitHub Desktop.

Select an option

Save lincolnthree/5364900 to your computer and use it in GitHub Desktop.
UISelectOne<Object> selectOne = (UISelectOne<Object>) input;
Converter<Object, String> converter = (Converter<Object, String>) InputComponents.getItemLabelConverter(
converterFactory, selectOne);
String value = converter.convert(InputComponents.getValueFor(input));
final Map<String, Object> items = new HashMap<String, Object>();
Iterable<Object> valueChoices = selectOne.getValueChoices();
if (valueChoices != null) {
for (Object choice : valueChoices) {
String itemLabel = converter.convert(choice);
items.put(itemLabel, choice);
combo.add(itemLabel);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment