I know about the @SelectItems that is available and how that could be a potential solution, but I would instead like to understand why something that was working perfectly in Seam 1.0 is broken when I moved to 1.1.
I have a SFSB that exposes a List attribute. The getter populates that List and the contents of the list are displayed using an h:selectOneRadio with f:selectItems.
@Stateful @Scope(ScopeType.CONVERSATION) @Name("loginClient") public class LoginClientBean implements LoginClient { ... private List<SelectItem> customerTypes; public List<SelectItem> getCustomerTypes() { customerTypes = new LinkedList<SelectItem>(); ... Adding to customerTypes return customerTypes; } public void setCustomerTypes(List<SelectItem> customerTypes) { this.customerTypes = customerTypes; }
<h:selectOneRadio id="customerType" value="#{loginClient.selectedCustomerType}" required="true"> <f:selectItems value="#{loginClient.customerTypes}" /> </h:selectOneRadio>
java.lang.IllegalArgumentException: Value binding '#{userMaintenanceClient.usersSelectItems}'of UISelectItems with component-path {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /UserMaintenance.xhtml][Class: javax.faces.component.html.HtmlForm,Id: userMaintenance][Class: javax.faces.component.html.HtmlPanelGrid,Id: _id23][Class: javax.faces.component.html.HtmlPanelGroup,Id: _id24][Class: javax.faces.component.html.HtmlSelectOneRadio,Id: selectRadio][Class: javax.faces.component.UISelectItems,Id: _id25]} does not reference an Object of type SelectItem, SelectItem[], Collection or Map but of type : null