6 Replies Latest reply on Feb 2, 2012 4:49 AM by Jacek Bilski

    rich:datascroller not scrolling rich:dataGrid?

    Todd Gould Novice

      Hello all,

       

      I am using RichFaces 3.3.3.Final.

       

      I am having trouble getting the rich:datascroller to scroll the rich:dataGrid.  The datascroller represents the proper number of pages for the data in the dataGrid.  However, when I select any of the datascroller controlls, the ajax request processes (as witnessed via the associated status), but the dataGrid remains on the first page.  Nothing seems to be able to make it progress to another page.  No ajax or other errors are generated and all appears to function well except that the datGrid does not scroll..  I'd appreciate any help with this as I am stuck.  Here is the form containg both the dtaaGrid and the datascroller:

       






      <a4j:form id="StatisticsForm" width="100%" style="height: 100%;" status="StatisticsStatus">













      <ui:decorate id="statisticsDecoration" template="/templates/centered.xhtml">







      <a4j:outputPanel id="CPSStatisticsOutputPanel">














      <h:outputText id="noCPSStatsText" value="#{msgs.noCPSStatisticsMsg}"











        rendered="#{empty statisticsController.CPSMessageStatistics}"/>

















      <rich:dataGrid id="CPSDataGrid" value="#{statisticsController.CPSMessageStatistics}" var="stat"









      columns="#{CS3Admin.STATISTICS_COLUMNS}" elements="#{CS3Admin.STATISTICS_ELEMENT_COUNT}"









      border="0" width="100%"









      rendered="#{not empty statisticsController.CPSMessageStatistics}">









      <rich:panel bodyClass="pbody">










      <f:facet name="header">











      <h:outputText value="#{stat.key}"></h:outputText>










      </f:facet>










      <h:panelGrid columns="2">











      <h:outputText value="Count:" styleClass="label"












      rendered="#{not stat.count}" />











      <h:outputText value="#{stat.value}" />










      </h:panelGrid>









      </rich:panel>









      <f:facet name="footer">










      <rich:datascroller renderIfSinglePage="false" status="StatisticsStatus"/>









      </f:facet>








      </rich:dataGrid>






      </a4j:outputPanel>
















      <rich:spacer/>











       








      <a4j:outputPanel id="CPSRateBarPanel">







      </a4j:outputPanel>















      <a4j:outputPanel id="CPSStatisticsResetButtonPanel">








      <rich:spacer/>
























      <a4j:commandLink id="statisticsResetButton" value="#{msgs.resetStatisticsLabel}" status="StatisticsStatus"









      oncomplete="if (#{facesContext.maximumSeverity==null || facesContext.maximumSeverity.ordinal==0}) #{rich:component('resetStatisticsConfirmationPanel')}.show();"








      reRender="resetStatisticsConfirmationPanel, CPSStatisticsOutputPanel, CPSRateBarPanel, CPSStatisticsResetButtonPanel"








      rendered="#{not empty statisticsController.CPSMessageStatistics}"/>






      </a4j:outputPanel>






      </ui:decorate>






      </a4j:form>

       

        • 1. Re: rich:datascroller not scrolling rich:dataGrid?
          Todd Gould Novice

          I apolgize for the format of the above.  Not sure why, but whenever I paste in the code this is how it gets formatted.

          • 2. Re: rich:datascroller not scrolling rich:dataGrid?
            Todd Gould Novice

            Just modified the rich:dataGrid to be a rich:dataTable out of curiousity, and the rich:datscroller now works as expected.  I'm not sure if this is an issue with the rich:dataGrid or the rich:datascroller or (more likely) something simple I am missing.  The dataGrid is the preferable control for our use, but we need the scroller to work with it.  Any ideas will be appreciated!

            • 3. Re: rich:datascroller not scrolling rich:dataGrid?
              Todd Gould Novice
              Here is the complete form again in a more readable format.  Notice that the rich:dataGrid is removed (via  tags) and that a very similar rich:dataTable is in it's place.  Using the dataTable version, the datascroller works fine.  Swapping back to the dataGrid version, the datascroller no longer functions.  I would greatly appreciate any help in tracking down and resolving this issue. 

               

               

              {code:xml}

               

               

                                  <a4j:form id="StatisticsForm" width="100%" style="height: 100%;" status="StatisticsStatus">

               

                                      <ui:decorate id="statisticsDecoration" template="/templates/centered.xhtml">

                                          <a4j:outputPanel id="CPSStatisticsOutputPanel">                           

                                              <h:outputText id="noCPSStatsText" value="#{msgs.noCPSStatisticsMsg}"

                                                            rendered="#{empty statisticsController.CPSMessageStatistics}"/>

               

                                              <ui:remove>

                                              <rich:dataGrid id="CPSDataGrid" value="#{statisticsController.CPSMessageStatistics}" var="stat"

                                                  columns="#{CS3Admin.STATISTICS_COLUMNS}" elements="#{CS3Admin.STATISTICS_ELEMENT_COUNT}"

                                                  border="0" width="100%"

                                                  rendered="#{not empty statisticsController.CPSMessageStatistics}">

                                                  <rich:panel bodyClass="pbody">

                                                      <f:facet name="header">

                                                          <h:outputText value="#{stat.key}"></h:outputText>

                                                      </f:facet>

                                                      <h:panelGrid columns="2">

                                                          <h:outputText value="Count:" styleClass="label"

                                                              rendered="#{not stat.count}" />

                                                          <h:outputText value="#{stat.value}" />

                                                      </h:panelGrid>

                                                  </rich:panel>

                                                  <f:facet name="footer">

                                                      <rich:datascroller renderIfSinglePage="false" status="StatisticsStatus"/>

                                                  </f:facet>

                                              </rich:dataGrid>

                                              </ui:remove>

                                              <rich:dataTable id="CPSDataGrid" value="#{statisticsController.CPSMessageStatistics}" var="stat"

                                                  rows="8" border="0" width="100%"

                                                  rendered="#{not empty statisticsController.CPSMessageStatistics}">

               

                                                  <f:facet name="header">

                                                      <rich:columnGroup>

                                                          <h:column>

                                                              <h:outputText styleClass="bold" value="MFN" />

                                                          </h:column>

                                                          <h:column>

                                                              <h:outputText styleClass="bold" value="Count" />

                                                          </h:column>                                       

                                                      </rich:columnGroup>

                                                  </f:facet>

                                                  <h:column>

                                                      <h:outputText value="#{stat.key}"></h:outputText>                                       

                                                  </h:column>

                                                  <h:column>

                                                      <ui:remove>

                                                      <h:outputText value="Count:" styleClass="label"

                                                          rendered="#{not stat.count}" />

                                                      </ui:remove>

                                                      <h:outputText value="#{stat.value}" />

                                                  </h:column>

                                                  <f:facet name="footer">

                                                      <rich:datascroller renderIfSinglePage="false" status="StatisticsStatus"/>

                                                  </f:facet>

                                              </rich:dataTable>

                                          </a4j:outputPanel>

               

                                          <a4j:outputPanel id="CPSStatisticsResetButtonPanel">

                                              <rich:spacer/>

               

                                              <a4j:commandLink id="statisticsResetButton" value="#{msgs.resetStatisticsLabel}" status="StatisticsStatus"

                                                  oncomplete="if (#{facesContext.maximumSeverity==null || facesContext.maximumSeverity.ordinal==0}) #{rich:component('resetStatisticsConfirmationPanel')}.show();"

                                                  reRender="resetStatisticsConfirmationPanel, CPSStatisticsOutputPanel, CPSRateBarPanel, CPSStatisticsResetButtonPanel"

                                                  rendered="#{not empty statisticsController.CPSMessageStatistics}"/>

                                          </a4j:outputPanel>

                                      </ui:decorate>           

                                  </a4j:form>

               

              {code}

              • 4. Re: rich:datascroller not scrolling rich:dataGrid?
                Todd Gould Novice

                Sorry for the bump, but I am wondering if anyone else is running into this.  As the datascroller works fine in the above code with a dataTable, I am inclined to think that this is a bug with the dataGrid?  Can anyone confirm this or help me to figure out what I may be missing to make the datascroller work with the dataGrid?

                • 6. Re: rich:datascroller not scrolling rich:dataGrid?
                  Jacek Bilski Newbie

                  Hi,

                   

                  We've come to another issue related to dataScroller and dataGrid. In out case switching between pages works as expected, but commandLinks don't. That is in every element displayed by grid there's commandLink. When we are on the first page links works, when on any other, they don't. There are no faces errors, logging set to debug for com.sun.faces, com.sun.facelets, org.richfaces and org.ajax4jsf doesn't give a clue as to what is wrong.

                   

                  Besides, documentation for dataScroller says "The component designed for providing the functionality of tables scrolling using Ajax requests.". Is dataGrid a table in RichFaces terminology? I have some doubts.