4 Replies Latest reply on Jun 10, 2010 7:56 AM by ilya_shaikovsky

    rich:extendedDataTable firing dataModel unnecessarily

      I've been using the extendedDataTable on multiple tabs and I have been finding what I think are unncessary calls to fetch the dataModel. 
      I'm aware that a fix for this was part of 3.3.1 (RF-3341).  I checked out the tests 3341/Bean.java & Capital.java, along with the 3341/rf3341.xhtml to see if I could manually pass the test that was used for the release.
      From what I can determine from the test, the getCapitals() method (dataTable on tab1) is expected to
      a) fire for the blur event once if the rendered checkbox is unchecked(renderRegionOnly=false), and
      b) shouldn't fire at all if checked(renderRegionOnly=true).
      What I am seeing for a rich:dataTable on the blur event is:
      a) 3 times for unchecked(renderRegionOnly=false), and
      b) 2 times for checked(renderRegionOnly=true).
      (It fires once for submission of the form for either a or b).
      For the rich:extendedDataTable on the blur event I found:
      a) 3 times for unchecked
      b) 3 times for checked 
      It also fires 2 times for submission of the form for either a or b.
      The results don't seem to be what I'd expect from how I can see the test was formed.  I've also attempted using the "limitToList" option as well but with no luck.  Anyone else experiencing similar issues?
      richfaces3.3.3Final
      Tomcat 6
      myfaces 1.2.5
      session scoped bean
        • 1. Re: rich:extendedDataTable firing dataModel unnecessarily
          ilya_shaikovsky
          I've also attempted using the "limitToList" option as well but with no luck.

          It's official solution. if you using limittolist=true on control - dataTable should not call for model on requests from the control. So please show your code if it's fails for you.

           

          Also you could check the second workaround with region - but it's not really convenient for all the cases.

          • 2. Re: rich:extendedDataTable firing dataModel unnecessarily

            here's the code:

             

            <rich:tabPanel switchType="ajax" selectedTab="#{bean.selectedTab}" id="tabPanel" >
            
            <rich:tab id="tab1" label="First" limitToList="true" reRender="dt1">
            
            <h:form id="f1">
            <rich:extendedDataTable id="dt1" value="#{bean.capitals1}" var="cap1" >
            <rich:column> 
            <h:outputText value="#{cap1.name}" />
            </rich:column> 
            </rich:extendedDataTable>
            </h:form> 
            </rich:tab> 
            
            <rich:tab id="tab2" label="Second" limitToList="true" reRender="dt2" >
            
            <h:form id="f2">
            <rich:extendedDataTable id="dt2" value="#{bean.capitals2}" var="cap2" >
            <rich:column> 
            <h:outputText value="#{cap2.name}" />
            </rich:column> 
            </rich:extendedDataTable>
            </h:form> 
            
            </rich:tab> 
            
            <rich:tab id="tab3" label="Third" name="tab3" limitToList="true" reRender="f3" >
            <h:form id="f3">
            This is the third tab
            </h:form> 
            </rich:tab> 
            
            </rich:tabPanel>
            
            
            
            
            
            
            
            
            
            
            

             

            <rich:tabPanel switchType="ajax" selectedTab="#{bean.selectedTab}" id="tabPanel" >
            
            <rich:tab id="tab1" label="First" limitToList="true" reRender="dt1">
            
            <h:form id="f1">
            <rich:extendedDataTable id="dt1" value="#{bean.capitals1}" var="cap1" >
            <rich:column> 
            <h:outputText value="#{cap1.name}" />
            </rich:column> 
            </rich:extendedDataTable>
            </h:form> 
            </rich:tab> 
            
            <rich:tab id="tab2" label="Second" limitToList="true" reRender="dt2" >
            
            <h:form id="f2">
            <rich:extendedDataTable id="dt2" value="#{bean.capitals2}" var="cap2" >
            <rich:column> 
            <h:outputText value="#{cap2.name}" />
            </rich:column> 
            </rich:extendedDataTable>
            </h:form> 
            
            </rich:tab> 
            
            <rich:tab id="tab3" label="Third" name="tab3" limitToList="true" reRender="f3" >
            <h:form id="f3">
            This is the third tab
            </h:form> 
            </rich:tab> 
            
            </rich:tabPanel>
            
            
            
            
            
            
            
            
            
            
            

             

             

             

            sample output:

             

            setSelectedTab = tab1
            getCapitals1()getCapitals2()getCapitals1()getCapitals2()
            setSelectedTab = tab2
            getCapitals1()getCapitals1()getCapitals2()getCapitals2()getCapitals1()
            setSelectedTab = tab3
            getCapitals1()getCapitals2()getCapitals1()getCapitals2()
            



            • 3. Re: rich:extendedDataTable firing dataModel unnecessarily
              ilya_shaikovsky

              looks like real issue in extendedDataTable itself.. working fine with simple dataTable.

              • 4. Re: rich:extendedDataTable firing dataModel unnecessarily
                ilya_shaikovsky

                feel free to rise an issue but currently we have no plans for 3.x branch.