1 Reply Latest reply on Mar 26, 2008 8:52 AM by andreas_back

    rich:scrollableDataTable and loading of data into the server

    andreas_back

      Hello!

      It is a really great experience to scroll within Firefox or Internet-Explorer
      if table that is scrolled has 25000 rows. And it works with considerable
      speed if hideWhenScrolling has the value true.

      Under Firefox it does not render the table in each situation correctly,
      but after hitting the scroll-arrows the content is normally visible again.

      But in a multiuser internet application it is not acceptable to load all the
      25000 rows into the memory of the server.

      Therefore I tried a lazy loading list and used it as the return for the
      corresponding getAllArticles method:

      value="#{dataTableScrollerBean.allArticles}"

      But I had to realize that ComponentSortableDataModel.setWrappedData
      converts it into an Array list and calls each row of the table and therefore
      loading each row into the memory!

      * So is there a way not to load all the data of the table into the servers memory for a scrollableDataTable?

      * Is there a way to switch of the sorting of scrollableDataTable?

      * Is it easier not to load all the tables data into the memory if the sorting is switched off?

      Greetings

      Andreas

        • 1. Re: rich:scrollableDataTable and loading of data into the se
          andreas_back

          Hello!

          For working with large tables with for example 160000 rows I tried the following:

          1. The method getAllArticles returns a ListDataModel.

          org.richfaces.model.impl.ListDataModel


          2. The lazy loading list is wrapped by the ListDataModel:

          public ListDataModel getAllArticles() {
          synchronized (this) {
          if (allArticles == null) {

          allArticles = new ListDataModel(LazyLoadingList.buildLasyLoadingList());
          }
          }
          return allArticles;
          }


          Now the scrollableDataTable seems to pull only the rows that are actually
          scrolled by the user.

          Greetings

          Andreas