1 Reply Latest reply on Jan 15, 2008 3:31 AM by Alexander Seitz

    datascroller and db hits

    Arbi Sookazian Master

      I read the richfaces ref pdf on rich:datascroller and it doesn't state how many (or when) db hits occur when you use a datascroller with datatable.

      what happens when you click on different page #'s in the datascroller control (or next, previous, etc.)? is there a simple filter/refresh to the UI or a db hit and refresh of the UI?

      see example below:

      <rich:datascroller align="left" for="myList" maxPages="20" rendered="#{noteAction.getNoteLogList().size() > 0}"/>
       <rich:spacer height="30" rendered="#{noteAction.getNoteLogList().size() > 0}"/>
       <rich:dataTable width="483" id="myList" rows="5"
       value="#{noteAction.getNoteLogList()}" var="myRow"
       rendered="#{noteAction.getNoteLogList().size() > 0}">
       <f:facet name="header">
       <rich:columnGroup>
       <h:column>
       <h:outputText styleClass="headerText" value="NoteText" />
       </h:column>
       <h:column>
       <h:outputText styleClass="headerText" value="TimeStamp" />
       </h:column>
       </rich:columnGroup>
       </f:facet>
      
       <h:column>
       <h:outputText value="#{myRow.noteText}"/>
       </h:column>
       <h:column>
       <h:outputText value="#{myRow.timeStamp}">
       <s:convertDateTime dateStyle="short" timeStyle="medium" type="both"/>
       </h:outputText>
       </h:column>
       </rich:dataTable>


        • 1. Re: datascroller and db hits
          Alexander Seitz Newbie

          Hi,

          per default, the rich:dataTable/dataScroller is working with a list loaded into memory. No database backing. So when you paginate there is no db hit for fetching the rows to show, instead you get a sublist of the list in memory. If you want a lazy loading list backed by a db-query you can search this forum. There are several threads about this topic.

          Regards,

          Alexander