Search code examples
ajaxjsfjsf-2richfaces

Richfaces 4.4 ExtendedDataTable spam Ajax requests after scroll down


The problem is when i use global status for ajax requests and ExtendedDataTable together strange bug happens - when i scroll down (i have large data loaded in the table) ajax request keep spaming in the console and the ajax status (picture loading) keep flashing. there is my code:

<h:head></h:head>
<h:body>
    <h:outputText value="TEsts with Extended Table" />
    <h:form id="form">
        <a4j:status id="waithStatus"
            onstart="#{rich:component('waithStatusPanel')}.show();"
            onstop="#{rich:component('waithStatusPanel')}.hide();">
            <f:facet name="start">
                <rich:popupPanel id="waithStatusPanel" autosized="true">
                    <h:graphicImage library="images" name="waith.gif" />
                </rich:popupPanel>
            </f:facet>
        </a4j:status>

        <h:panelGrid columns="2">
            <rich:extendedDataTable value="#{testKrasi.tableList}" var="row" id="table" 
             selectionMode="none" clientRows="10" style="height:250px;width:400px"
             iterationStatusVar="it">
             <rich:column>
                <f:facet name="header">#</f:facet>
                  #{it.index}
             </rich:column>
             <rich:column filter="#{testKrasi.vendorFilter}" filterType="custom">
                <f:facet name="header">
                    vendor
                </f:facet>
                <h:outputText value="#{row[1]}"/>
            </rich:column>
            <rich:column filter="#{testKrasi.modelFilter}" filterType="custom">
                <f:facet name="header">
                    model
                </f:facet>
                <h:outputText value="#{row[2]}"/>
            </rich:column>          
                   </rich:extendedDataTable>
        </h:panelGrid>
    </h:form>
</h:body>
</html>

and there is screenshot of the firebug console every second a ajax request fires

the AJAX response is

<partial-response>
<changes>
<update id="javax.faces.ViewState">-2313795786913874202:5967295793801101249</update>
</changes>
</partial-response>

I don't know what to do... i try to fix this problem over a week now... Please help me.


Solution

  • As you are using ajax lazy data loading for the table, these data load requests cause status to show.

    You need either disable ajax data loading if you don't need that (refer to RichFaces Showcase to know how). Or to disable status to show on the table updates. You can wrap the table into a4j:region to do this.