You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by wfaler <wi...@gmail.com> on 2007/10/08 13:01:42 UTC

Lazy loading pageable listview

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


Re: Lazy loading pageable listview

Posted by Igor Vaynberg <ig...@gmail.com>.
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 <wi...@gmail.com> 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 <wi...@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
> >
> >
> >
>
> --
> 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: 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


Re: Lazy loading pageable listview

Posted by wfaler <wi...@gmail.com>.
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 <wi...@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
> 
> 
> 

-- 
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Lazy loading pageable listview

Posted by Igor Vaynberg <ig...@gmail.com>.
have you looked in wicket-examples under repeaters?

-igor


On 10/8/07, wfaler <wi...@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


Re: Lazy loading pageable listview

Posted by Kent Tong <ke...@cpttm.org.mo>.

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);
	}
}


-----
--
Kent Tong
Wicket tutorials freely available at http://www.agileskills2.org/EWDW
-- 
View this message in context: http://www.nabble.com/Lazy-loading-pageable-listview-tf4587413.html#a13113194
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


Re: Lazy loading pageable listview

Posted by bchi49 <bc...@gmail.com>.
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..
> 

-- 
View this message in context: http://www.nabble.com/Lazy-loading-pageable-listview-tp13094415p19321614.html
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