Lazy loading pageable listview

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Lazy loading pageable listview

Wille Faler
Hi,
I have a page where I have a DataContainer that shows ten items at a time, with paging links at the bottom.
Is there any way of lazy-loading the contents of the datacontainer?
I need to do this, as the amount of data is very large (up to 300 000 rows, depending on the search criteria).

I have found a bunch of stuff around IDataProvider, DataView etc, but I haven't found any meaningful examples that helps a great deal..
Reply | Threaded
Open this post in threaded view
|

Re: Lazy loading pageable listview

Igor Vaynberg-2
have you looked in wicket-examples under repeaters?

-igor


On 10/8/07, wfaler <[hidden email]> wrote:

>
> Hi,
> I have a page where I have a DataContainer that shows ten items at a time,
> with paging links at the bottom.
> Is there any way of lazy-loading the contents of the datacontainer?
> I need to do this, as the amount of data is very large (up to 300 000 rows,
> depending on the search criteria).
>
> I have found a bunch of stuff around IDataProvider, DataView etc, but I
> haven't found any meaningful examples that helps a great deal..
> --
> View this message in context: http://www.nabble.com/Lazy-loading-pageable-listview-tf4587413.html#a13094415
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Lazy loading pageable listview

Wille Faler
Yes some of them, but they mostly seem to be focused around minimizing what is serialized into a session, not how to lazy load a large amount of data that needs to be paged through.
I don't need to retrieve "id's only", I need to limit the amount of id's that I get in one go.

igor.vaynberg wrote
have you looked in wicket-examples under repeaters?

-igor


On 10/8/07, wfaler <wille.faler@gmail.com> wrote:
>
> Hi,
> I have a page where I have a DataContainer that shows ten items at a time,
> with paging links at the bottom.
> Is there any way of lazy-loading the contents of the datacontainer?
> I need to do this, as the amount of data is very large (up to 300 000 rows,
> depending on the search criteria).
>
> I have found a bunch of stuff around IDataProvider, DataView etc, but I
> haven't found any meaningful examples that helps a great deal..
> --
> View this message in context: http://www.nabble.com/Lazy-loading-pageable-listview-tf4587413.html#a13094415
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Reply | Threaded
Open this post in threaded view
|

Re: Lazy loading pageable listview

Igor Vaynberg-2
well, all the examples in there that page only retrieve records for
that page, so im not sure what you are talking about.

-igor


On 10/8/07, wfaler <[hidden email]> wrote:

>
> Yes some of them, but they mostly seem to be focused around minimizing what
> is serialized into a session, not how to lazy load a large amount of data
> that needs to be paged through.
> I don't need to retrieve "id's only", I need to limit the amount of id's
> that I get in one go.
>
>
> igor.vaynberg wrote:
> >
> > have you looked in wicket-examples under repeaters?
> >
> > -igor
> >
> >
> > On 10/8/07, wfaler <[hidden email]> wrote:
> >>
> >> Hi,
> >> I have a page where I have a DataContainer that shows ten items at a
> >> time,
> >> with paging links at the bottom.
> >> Is there any way of lazy-loading the contents of the datacontainer?
> >> I need to do this, as the amount of data is very large (up to 300 000
> >> rows,
> >> depending on the search criteria).
> >>
> >> I have found a bunch of stuff around IDataProvider, DataView etc, but I
> >> haven't found any meaningful examples that helps a great deal..
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Lazy-loading-pageable-listview-tf4587413.html#a13094415
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Lazy-loading-pageable-listview-tf4587413.html#a13102138
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Lazy loading pageable listview

Kent Tong
In reply to this post by Wille Faler
wfaler wrote
I have found a bunch of stuff around IDataProvider, DataView etc, but I haven't found any meaningful examples that helps a great deal..
Some sample code below. There is a whole chapter on this topic in my e-book
(see my signature for location).

public class LazyLoad extends WebPage {

        public LazyLoad() {
                IColumn[] columns = new IColumn[] {
                                new PropertyColumn(new Model("col1"), "intValue"),
                                new PropertyColumn(new Model("col2"), "class") };
                ISortableDataProvider dataProvider = new SortableDataProvider() {

                        public int size() {
                                return 300000;
                        }

                        public IModel model(Object object) {
                                return new Model((Integer) object);
                        }

                        public Iterator iterator(int first, int count) {
                                return loadEntriesFromDatabase(first, count).iterator();
                        }

                        private List<Integer> loadEntriesFromDatabase(int first, int count) {
                                List<Integer> items = new ArrayList<Integer>();
                                for (int i = 0; i < count; i++) {
                                        items.add(new Integer(first + i));
                                }
                                return items;
                        }

                };
                DefaultDataTable t = new DefaultDataTable("t", columns, dataProvider, 3);
                add(t);
        }
}
Reply | Threaded
Open this post in threaded view
|

Re: Lazy loading pageable listview

bchi49
In reply to this post by Wille Faler
Take a look at Lazy List: http://www.icefaces.org/JForum/posts/list/8549.page

This works simpler.


wfaler wrote
Hi,
I have a page where I have a DataContainer that shows ten items at a time, with paging links at the bottom.
Is there any way of lazy-loading the contents of the datacontainer?
I need to do this, as the amount of data is very large (up to 300 000 rows, depending on the search criteria).

I have found a bunch of stuff around IDataProvider, DataView etc, but I haven't found any meaningful examples that helps a great deal..