rich:dataTable always rerender
racadent Nov 9, 2009 2:21 PMHi all,
I have one problem which I cannot get rid of it for 3 days. The problem is that in my web page I have 4 tabs and each tab has one rich:dataTable. Every action on whatever component (which is not rich:dataTable), fires rich:dataTable rerender (precisely, calls my method in the model which fills the table), even if parameter
ajaxSingle="true"
is set on for example component that has no relation with those tables. So each time some action is triggered I always have 4 redundant
selectqueries (one for each table).
Here is my code for one of the tables:
<rich:dataTable id="smsCodeList" value="#{shortCodePage.smsShortCodesList}" var="smsShortCodes" rows="10" reRender="ds"> <rich:column sortBy="#{smsShortCodes.pk.code}" filterBy="#{smsShortCodes.pk.code}" filterEvent="onkeyup" width="100"> <f:facet name="header"> <h:outputText value="#{messages['shortcode.shortcode']}" /> </f:facet> <h:outputText value="#{smsShortCodes.pk.code}" /> </rich:column> <rich:column rendered="#{sso.admin}" sortBy="#{smsShortCodes.assignee}" filterBy="#{smsShortCodes.assignee}" filterEvent="onblur" width="200"> <f:facet name="header"> <h:outputText value="#{messages['shortcode.assignee_id']}" /> </f:facet> <h:outputText value="#{smsShortCodes.assignee}" /> </rich:column> <rich:column rendered="#{sso.admin}" sortBy="#{smsShortCodes.assigneeName}" filterBy="#{smsShortCodes.assigneeName}" filterEvent="onblur" width="200"> <f:facet name="header"> <h:outputText value="#{messages['shortcode.assignee_name']}" /> </f:facet> <h:outputText value="#{smsShortCodes.assigneeName}" /> </rich:column> <rich:column sortBy="#{smsShortCodes.status}" filterBy="#{smsShortCodes.status}" filterEvent="onblur" width="100"> <f:facet name="header"> <h:outputText value="#{messages['shortcode.status']}" /> </f:facet> <h:outputText value="#{smsShortCodes.status}" /> </rich:column> <rich:column sortBy="#{smsShortCodes.reservedTo}" filterBy="#{smsShortCodes.reservedTo}" filterEvent="onblur" width="60"> <f:facet name="header"> <h:outputText value="#{messages['shortcode.reserved_to']}" /> </f:facet> <h:outputText value="#{smsShortCodes.reservedTo}"> <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" timeZone="CET"/> </h:outputText> </rich:column> <rich:column sortBy="#{smsShortCodes.validTo}" filterBy="#{smsShortCodes.validTo}" filterEvent="onblur" width="60"> <f:facet name="header"> <h:outputText value="#{messages['shortcode.valid_to']}" /> </f:facet> <h:outputText value="#{smsShortCodes.validTo}" > <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" timeZone="CET"/> </h:outputText> </rich:column> <rich:column rendered="#{sso.admin}" width="1600px"> <f:facet name="header"> <a:commandButton style="margin-left:5px" styleClass="button" value="#{messages['search']}" /> </f:facet> <a:commandButton style="margin-left:5px" styleClass="button" action="#{shortCodePage.allow('sms', smsShortCodes.pk.code)}" value="#{messages['shortcode.allow']}" rendered="#{smsShortCodes.status=='FORBIDDEN'}" eventsQueue="queue" reRender="smsCodeList, availableSmsPanel,availableSmsPanelReserve,txtSmsNote" /> <a:commandButton style="margin-left:5px" styleClass="button" action="#{shortCodePage.approve('sms', smsShortCodes.pk.code)}" value="#{messages['shortcode.approve']}" rendered="#{smsShortCodes.status=='RESERVED'}" eventsQueue="queue" reRender="smsCodeList, availableSmsPanel,availableSmsPanelReserve,txtSmsNote" /> <a:commandButton style="margin-left:5px" styleClass="button" action="#{shortCodePage.block('sms', smsShortCodes.pk.code)}" value="#{messages['shortcode.block']}" rendered="#{smsShortCodes.status=='ACTIVE'}" eventsQueue="queue" reRender="smsCodeList, availableSmsPanel,availableSmsPanelReserve,txtSmsNote" /> <a:commandButton style="margin-left:5px" styleClass="button" action="#{shortCodePage.restore('sms', smsShortCodes.pk.code)}" value="#{messages['shortcode.restore']}" rendered="#{smsShortCodes.status=='BLOCKED'}" eventsQueue="queue" reRender="smsCodeList, availableSmsPanel,availableSmsPanelReserve,txtSmsNote" /> <a:commandButton style="margin-left:5px" styleClass="button" action="#{shortCodePage.release('sms', smsShortCodes.pk.code)}" value="#{messages['shortcode.release']}" rendered="#{smsShortCodes.status=='BLOCKED' || smsShortCodes.status=='RESERVED'}" eventsQueue="queue" reRender="smsCodeList, availableSmsPanel,availableSmsPanelReserve,txtSmsNote" /> </rich:column> <rich:column rendered="#{!sso.admin}" width="100px"> <f:facet name="header"> <a:commandButton style="margin-left:5px" styleClass="button" value="#{messages['search']}" /> </f:facet> </rich:column> <f:facet name="footer"> <rich:datascroller id="ds" renderIfSinglePage="false"></rich:datascroller> </f:facet> </rich:dataTable>
Can anyone help me?? Its quite urgent...