1 Reply Latest reply on Jun 26, 2009 9:24 AM by nbelaevski

    Understanding phases when using Extended Data Model

    aksamit

      Hi,

      I have followed the example on http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?tab=dataModel&cid=802960 and succesfully added data tables using an underlying extended data model.

      For one of my pages I have now gotten some problems. It is a page with a input fields, submit button and a datatable. On submit, input values are used to make selection from a dB where resultset is displayed in the datatable, the whole process is done entirely with A4J/RichFaces.

      The problem is that everytime the search button is pressed I have identified that up to 5 calls are made to the method:
      @Override
      public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument)

      Looking at the callstack I have identified the following phases of each call:

      * processDecodes
      * encodeAjax
      * processValidators
      * processUpdates
      * encodeAjax

      Each call to the walk method generates a costly lookup to the dB, why I would like to limit the calls to only the last one (where the actual input values are available). I have been elaborating with different attributes for the commandButton but can't limit the calls.

      This is my code for commandbutton:

      <a4j:commandButton value="#{generalbundle['search']}" reRender="logs" immediate="false" limitToList="true" actionListener="#{visibilityBean.newSearchActionListener}" styleClass="generalbutton" />

      "logs" is the ID for my <rich:dataTable> that gets values from the extended data model.

      Suggestions very welcome.

      // Mike