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
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to