[jboss-user] [JBoss Seam] - Re: Problem with s:selectItems

flashguru do-not-reply at jboss.com
Sat Mar 10 12:17:34 EST 2007

Curious, why do you have setCountries() accepting a list of Country while getCountries() is returning a list of SelectItem?

Anyway, in your code, you are creating instances of SelectItem yourself. If this is what you want, then use the standard JSF <f:selectItems> instead. However, you lose two things by doing that:

1- Because you will not be using Seam JSF <s:selectItems>, you can not take advantage of the convenient  noSelectionLabel attribute.
2- Your code is now tied to a SelectItem class.

Let?s assume that you have a class called Country. Then, to use Seam JSF <s:selectItems>, simply return a list of Country and do not wrap them with SelectItem. Also, make sure that the value binding for the <h:selectOneMenu> resolves to a type Country and not String. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026877#4026877

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026877

More information about the jboss-user mailing list