3 Replies Latest reply on Sep 21, 2010 9:39 PM by Siva P

    Unable to display rich:dataTable content when scroller is used

    Pradeep Sampath Newbie

      I have two JSPs in which <rich:dataTable>s exist with datascrollers. From JSP1 when invoked a button, it will lead to JSP2. In JSP2 I clicked on the datascroller and later (with some other action) navigate to JSP1. Here, if I view JSP2 again, the data is not shown for the datatable which the scroller has been invoked previously. Here, table header and column headers are shown, but the data is not displayed. I have checked if data exists and found that data exists but not displaying in UI.

       

      In JSP2 there are many datatables. All the datatables are similar with the referred beans being different. One datatble content is provided below:

       

      <rich:dataTable id="datatableID" width="100%" var="beaninstance" value="#{bean1.list1}"
                 rendered="#{ not empty bean1.list1}" rows="10" binding="#{bean1.bindingTable}">

           <f:facet name="header" >
                <h:outputText style="text-align: left;" value="#{bean1.tableHeaderName}" styleClass="section-header"></h:outputText>     
           </f:facet>
           <rich:column style="text-align: left;width: 15%;" headerClass="datatableheader" >
                <f:facet name="header">
                     <h:outputText  value="#" />
                </f:facet>
                <h:outputText value="#{bean1.bindingTable.rowIndex + 1}" styleClass="assetclassheading"></h:outputText>
           </rich:column>
           <rich:column style="text-align: left;width: 30%;" headerClass="datatableheader"
                sortBy="#{beaninstance.fullName}"  selfSorted="true" sortable="true" sortOrder="ASCENDING">

       

                <f:facet name="header">
                     <h:panelGrid columns="2">
                          <h:outputText  value="#{bean1.columnHeaderName}"  />
                     </h:panelGrid>
                </f:facet>
                <h:commandLink action="#{actionClass.processInquiry}" value="#{beaninstance.fullName}" styleClass="assetclassheading"
                     style="text-decoration:underline; color: #003466" rendered="#{beaninstance.renderLink}">

                     <f:param name="CODE" value="#{beaninstance.code}"></f:param>
                     <f:param name="TYPE" value="#{beaninstance.type}"></f:param>
                </h:commandLink>
                <h:outputText value="#{beaninstance.fullName}" styleClass="assetclassheading"
                     style="color: #666666;" rendered="#{!beaninstance.renderLink}"></h:outputText>
           </rich:column>
           <rich:column style="text-align: left;border-right-width: 1px;" headerClass="datatableheaderright"
                sortBy="#{beaninstance.code}"  selfSorted="true" sortable="true" sortOrder="ASCENDING">

               

                <f:facet name="header">
                     <h:panelGrid columns="2">
                          <h:outputText style="border-right-width: 1px;" value="Code"  />
                     </h:panelGrid>
                </f:facet>
                <h:outputText style="width: 40%;"  value="#{beaninstance.code}" styleClass="assetclassheading"></h:outputText>
           </rich:column>
      </rich:dataTable>
      <h:panelGroup id="dataSrcoller1" rendered="#{bean1.renderScrollerPage}">
           <div style="background-color: #E3E5E6;" class="table-border" >
          

                <rich:datascroller id="scrollerID" for="datatableID" renderIfSinglePage="false" maxPages="10" ajaxSingle="false" page="#{bean1.scrollerPage}" reRender="scrollerID, datatableID" />
          

           </div>
      </h:panelGroup>

       

      Similar datatable is available even in JSP1, but with reRender attribute in datascroller, this issue is gone. In JSP2 there are 4 datatables.

        • 1. Re: Unable to display rich:dataTable content when scroller is used
          raga t Newbie

          Hello,

           

          I'm also having the similar problem described below:

           

          1. I navigated from jsp1 to jsp2. In jsp2, the datatable is navigated to page1 to other page using the data scroller.
          2. Now I navigated again from jsp2 to jsp3 or jsp1.
          3. And when I revisit jsp2, the table headers are only getting displayed, not the data rows.

           

          Can anone help me on this? This is a major show stopper for our application. We are using RF 3.3.3.

          • 2. Re: Unable to display rich:dataTable content when scroller is used
            Pradeep Sampath Newbie

            Seems like I understood the problem. In our application we are showing the scroller only if the number of records are more than 10. Also we are resetting the scroller page evertime the page is loaded, and this setting is done through java action class.

             

            I found that this issue is coming only for the case where the scroller should not display when the second time we are viewing the page. If the scroller is shown always, this issue is not repeating.

             

            So I guess the following is the behavior of how the datascroller is working in richfaces:

            • Eventhough we set the scroller page in action class, it will reflect in UI only if the scroller is rendered.
            • If the scroller page is not reset and the scroller is not rendering, then the data to which that is tied will not be displayed.

             

            If my analysis is true, then the issue will not repeat if the scroller is rendered always, and after rendering it should be hidden if required. Now the issue for me is How will I hide the scroller after loading it?

             

            Can anyone please convey if my analysis is correct?

            • 3. Re: Unable to display rich:dataTable content when scroller is used
              Siva P Master

              use rendered attribute in the  <rich:datascroller

              like

              rendered="#{urBean.property == 'somevalue'}" when you like to show page u make the property value as null or set some other value.