2 Replies Latest reply on Apr 1, 2008 6:32 PM by jmiguel77

    rich:datascroller optimize

    jmiguel77

      Hi

      First of all, congratulations to all A4J/RichFaces team; you are doing a great job.

      One thing i think hasn't been covered yet is the optimization of rich:datascroller. I mean, i usually get all the data i need from the database, place it as value of a rich:dataTable and then put a datascroller to navigate the table.

      That means that the whole data from the database is in memory. Is there any way to make it work with only one page of data from the database at a time ???

      does it have to be done by hand ?? how ???

      thanks a lot and congratulations again !!!!

        • 1. Re: rich:datascroller optimize
          alankstewart

          Your search bean can extend the org.ajax4jsf.model.ExtendedDataModel class and ovveride methods such as walk, setRowKey, getRowCount, isRowAvailable, getRowData.
          We call facade (service layer) methods that use the Hibernate criteria api to set pagination boundaries using the Hibernate methods criteria.setFirstResult and criteria.setMaxResults to paginate the data. It works well - we have a table with 300,000 employees of our company and we can get the first, say 10 employees, all in lightening quick time.
          Alan

          • 2. Re: rich:datascroller optimize
            jmiguel77

            Hi Alan thanks a lot for the quick reply ??

            could you help me with some code ??

            thanks a lot