2 Replies Latest reply on Jan 28, 2008 2:39 PM by Alexander Eitner

    DataTable invokes bean one time too much

    Alexander Eitner Newbie

      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