[jboss-user] [JBoss Seam] - Re: Problems with extended EL syntax.

fernando_jmt do-not-reply at jboss.com
Mon Apr 16 01:29:55 EDT 2007


Actually, you should have this in your component:


  | 
  |   @DataModel
  |   List<String> strings;
  | 
  |   @Factory("strings")
  |   public void makeStrings() {
  |     strings = new List<String>();
  |     strings.add("Name1");
  |     strings.add("Name2");
  |   }
  | 
  | 

And this in your page:


  | <h:dataTable var="string" value="#{strings}>
  |   <h:column>
  |     <s:link value="#{string}" action="#{bean.test(string)}" />
  |   </h:column>
  | </h:dataTable>
  | 
	
Remember @Factory definition:
"@Factory specifies that the method of the component is used to initialize the value of the named context variable, when the context variable has no value.". So if you should use a @Factory for a context variable, and that context variable is defined in this case using @DataModel.


HTH.


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

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



More information about the jboss-user mailing list