[jboss-user] [JBoss Seam] - DataTable invokes bean one time too much

QPool.Char do-not-reply at jboss.com
Fri Jan 25 14:55:49 EST 2008


Hello, i have a small strange problem... 

I have a datatable inside my JSF code.


             <h:dataTable rendered="#{not empty pooledTaskInstanceList}"
  |                           value="#{showWorkflows.tableContent}"
  |                           var="task" >
  |                           
  |                 <h:column>
  |                     <f:facet name="header">  Id  </f:facet>
  |                     <h:outputText value="#{task.taskID}"/>
  |                 </h:column>
  |                ...
  |  
  | 
The JSF gets the data for the table as a Collection (ArrayList) from a stateless SessionBean.

  | 	public ArrayList<ExeWorkflow> getTableContent() {
  | 		
  | 		log.info("INVOKE getTableContent");
  | 		
  | 		ArrayList<ExeWorkflow> result = new ArrayList<ExeWorkflow>();
  | 
  | 		... (some jBPM code)
  | 
  |                 return result;
  | 

The Collection-objects are simple EntityClasses and the view is rendered correctly. But when i watch the JBOSS-console, i see that the getTableContent()-method is invoked always one time too often. Lets say we have one Object in the collection, then the method is invoked twice and so on...

Doesnt JSF just invoke this method one time and then create the datatable? Why should it invoke it so often? How can i assign a local var in JSF just for example like this: Collection c = value="#{showWorkflows.tableContent}" , so that it is just called one time?

Any more ideas?

Thx in advance

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

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



More information about the jboss-user mailing list