Skip to content

Commit

Permalink
Using Item label converter if available when setting UISelect values
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Aug 26, 2013
1 parent f32a48f commit 78840aa
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -191,8 +191,17 @@ private static Object convertToUIInputValue(final ConverterFactory converterFact
{
if (input instanceof SelectComponent)
{
Iterable<Object> valueChoices = ((SelectComponent<?, Object>) input).getValueChoices();
Converter<Object, Object> selectConverter = converterFactory.getConverter(targetType, sourceType);
SelectComponent<?, Object> selectComponent = (SelectComponent<?, Object>) input;
Iterable<Object> valueChoices = selectComponent.getValueChoices();
final Converter<Object, ?> selectConverter;
if (String.class.isAssignableFrom(sourceType))
{
selectConverter = (Converter<Object, ?>) getItemLabelConverter(converterFactory, selectComponent);
}
else
{
selectConverter = converterFactory.getConverter(targetType, sourceType);
}
Object chosenObj = null;
if (valueChoices != null)
{
Expand Down

0 comments on commit 78840aa

Please sign in to comment.