You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Frank Würffel (JIRA)" <de...@myfaces.apache.org> on 2008/05/26 16:55:55 UTC

[jira] Commented: (MYFACES-1875) UISelectOne value validation

    [ https://issues.apache.org/jira/browse/MYFACES-1875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599850#action_12599850 ] 

Frank Würffel commented on MYFACES-1875:
----------------------------------------

I resolved the issue by removing the converter and setting the itemValue to #{true} or #{false}
However I believe if a converter is set it should be used for the Menu value and the ItemValues alike.

> UISelectOne value validation
> ----------------------------
>
>                 Key: MYFACES-1875
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1875
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 1.1.5
>         Environment: Tomcat, Eclipse with Sysdeo Tomcat Plugin on Windows XP Client
>            Reporter: Frank Würffel
>            Priority: Minor
>
> validateValue(FacesContext context, Object value) Method of UISelectOne item checks values against list of SelectItems
> if (!_SelectItemsUtil.matchValue(value, new _SelectItemsIterator(this)))
> The value is a converted value whereas the SelectItem values returned from the _SelectItemsIterator are not being converted.
> Therefore the validity check does not work for anything else but String values or one must include a valuebinding in the SelectItem for every Value in the list.
> In my case I have two SelectItems with values 'true' and 'false'. A booleanConverter is registered with the UISelectOne to convert Strings to Boolean and back.
> The value is invalid as the comparison Boolean.equals(String) is false of course in the method call _SelectItemsUtil.matchValue:
> Object itemValue = item.getValue();
> if (value==itemValue || value.equals(itemValue))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.