Hi!

I found the problem's cause: SelectItem instances used in different
selectOneMenus should should not refer to the same value or label instances,
which might be the case if you use static variables.


Regards,

Matthias

> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Auftrag
> von Matthias Kahlau
> Gesendet: Donnerstag, 19. Januar 2006 00:48
> An: Users MyFaces
> Betreff: Problem with selectOneMany Value-Binding
>
>
> Hi!
>
>
> To create a List for the selectItems value, I do the following:
>
> 1) I create a List of Object Arrays of size 2 containing a constant
> Character as value and a constant String as label. The List is a static
> final LinkedList.
>
> 2) To build a List of SelectItem instances, I iterate over the List
> containing the Object Arrays in the following method:
>
> public static LinkedList createSelectItemsListCharKey(List objArrList) {
>     LinkedList linkedList = new LinkedList();
>     Iterator it = objArrList.iterator();
>     while (it.hasNext()) {
>       Object arr[] = (Object[])it.next();
>       Character value = (Character)arr[0];
>       String label = (String)arr[1];
>       linkedList.add(new SelectItem(value, label));
>     }
>     return linkedList;
>   }
>
> ---
>
> I think the problem is caused by the fact that step 2 is
> performed more than
> once with the same List from step 1, because I need the options
> in more than
> one selectOneMany.
>
> When I do this, I get the following error, and "umfrTypOptions" is one of
> many Lists of SelectItem instances. There are others build in other
> Backing-Beans.
>
>  Value binding '#{UmfrSuperManUmfrTabBacking.umfrTypOptions}'of
> UISelectItems with component-path {Component-Path : [Class:
> javax.faces.component.UIViewRoot,ViewId:
> /Management/ManagementTabbedPane.jsp][Class:
> javax.faces.component.html.HtmlForm,Id: managementForm][Class:
> org.apache.myfaces.custom.tabbedpane.HtmlPanelTabbedPane,Id: _id1][Class:
> org.apache.myfaces.custom.tabbedpane.HtmlPanelTab,Id: tab3][Class:
> javax.faces.component.html.HtmlPanelGrid,Id: _id158][Class:
> org.apache.myfaces.custom.column.HtmlSimpleColumn,Id: _id161][Class:
> javax.faces.component.html.HtmlSelectOneMenu,Id: umfragetyp2][Class:
> javax.faces.component.UISelectItems,Id: _id162]} does not reference an
> Object of type SelectItem, SelectItem[], Collection or Map but of type :
> null
> java.lang.IllegalArgumentException: Value binding
> '#{UmfrSuperManUmfrTabBacking.umfrTypOptions}'of UISelectItems with
> component-path {Component-Path : [Class:
> javax.faces.component.UIViewRoot,ViewId:
> /Management/ManagementTabbedPane.jsp][Class:
> javax.faces.component.html.HtmlForm,Id: managementForm][Class:
> org.apache.myfaces.custom.tabbedpane.HtmlPanelTabbedPane,Id: _id1][Class:
> org.apache.myfaces.custom.tabbedpane.HtmlPanelTab,Id: tab3][Class:
> javax.faces.component.html.HtmlPanelGrid,Id: _id158][Class:
> org.apache.myfaces.custom.column.HtmlSimpleColumn,Id: _id161][Class:
> javax.faces.component.html.HtmlSelectOneMenu,Id: umfragetyp2][Class:
> javax.faces.component.UISelectItems,Id: _id162]} does not reference an
> Object of type SelectItem, SelectItem[], Collection or Map but of type :
> null
>       at
> org.apache.myfaces.util.SelectItemsIterator.hasNext(SelectItemsIte
> rator.java
> :142)
>
>
> Do you know why this doesn't work? The collection or map pointed to in the
> error message cannot really be null, I think that's only a
> symptom produced
> by JSF... When I use a step 2 List only one time, no error happens.
>
>
> Regards,
>
> Matthias
>

Reply via email to