You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "David Brainard (JIRA)" <de...@myfaces.apache.org> on 2007/10/26 23:54:51 UTC

[jira] Commented: (MYFACES-1744) Validation messages is shown for SelectOneMenu in case first child is not SelectItems or SelectItem

    [ https://issues.apache.org/jira/browse/MYFACES-1744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538114 ] 

David Brainard commented on MYFACES-1744:
-----------------------------------------

I have checked with the RI impl they dont have this problem.  

In myfaces if i have any type of component like f:param and f:valuechanelistener etc before f:selectitem or  f:selectitems  SelectItemsIterator and _SelectItemsIterator does not return correct value for hasNext(). 

I have added the following patch to both the classes SelectItemsIterator and _SelectItemsIterator so that they ignore the children which are not UISelectItem and UISelectItems.

if (_childs.hasNext())
        {
            UIComponent child = (UIComponent) _childs.next();
            while(!(child instanceof UISelectItem)
            		&& !(child instanceof UISelectItems))
            {
            	child = (UIComponent) _childs.next();
            }

Pls comment if this approach is not suitable. 

i'll add a patch for this soon.

> Validation messages is shown for SelectOneMenu in case first child is not SelectItems or SelectItem
> ---------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1744
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1744
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.5
>         Environment: Windows XP
>            Reporter: Galina Gavrilo
>
> If SelectOneMenu has child of another type than SelectItems or SelectItem at first place in the children list (e.g. itomahawk jsValueChangeListener), validation of combobox fails with message "Value is not a valid option." Value range is empty in this case because _SelectItemsIterator hasNext() method returns false if first child is not of type SelectItems or SelectItem. It should just skip such children, and should continue looking for values. Right?

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