[jboss-user] [JBoss Seam] - Re: Drop Down Menu Using Seam and Facelets
yj4jboss
do-not-reply at jboss.com
Fri Sep 22 08:43:45 EDT 2006
Hello Denis,
I am trying to get your example of implementing SelectItems without custom annotations. I have included the the following code in my SFSB.
|
|
|
| @Stateful
| @Name("companySearch")
| @Scope(ScopeType.SESSION)
| @Interceptors(SeamInterceptor.class)
|
| public class CompanySearchBean implements CompanySearch, Serializable {
|
|
| <! -- Bean Specific Code goes here -->
|
| public Map<String,Object> model;
|
|
| private void fillMaps(){
| model = new TreeMap<String,Object>();
| model.put("(Empty)","-1"); // Add EMPTY element if needed
| for (Object o: yearList) {
| String label = o.toString();
| model.put(label, o );
| }
| }
|
|
| public Map<String,Object> getModel(){ // f:selectItems value
| log.debug("Initializing Model");
| log.debug("Model Size = "+model.size());
| return model;
| }
|
|
|
|
| public Converter getConverter() {
| return new ReferenceConverter(yearList);
| }
|
This is my code in the my search.xhtml file
|
| <h:selectOneMenu converter="#{companySearch.converter}">
| <f:selectItems value="#{companySearch.model}" />
| </h:selectOneMenu>
|
Is this the right approach ??
I am getting a "Cannot get property model" error
Plz help....and thnx in advance....
Yogesh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973547#3973547
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973547
More information about the jboss-user
mailing list