models that supports just query things what is needed.
See the wicket.extensions.markup.html.repeater.* package for Components/Models.
In the wicket-examples/repeater we have examples for that.
for example:
public class ContactDataProvider implements IDataProvider
{
protected ContactsDatabase getContactsDB()
{
return DatabaseLocator.getDatabase();
}
/**
* retrieves contacts from database starting with index <code>first</code>
* and ending with <code>first+count</code>
*
* @see wicket.extensions.markup.html.repeater.data.IDataProvider#iterator(int,
* int)
*/
public Iterator iterator(int first, int count)
{
return getContactsDB().find(first, count, "firstName", true).iterator(); <<<<<<<<<<<<<<<<<<<<<
}
/**
* returns total number of contacts in the database
*
* @see wicket.extensions.markup.html.repeater.data.IDataProvider#size()
*/
public int size()
{
return getContactsDB().getCount();
}
/**
* wraps retrieved contact pojo with a wicket model
*
* @see wicket.extensions.markup.html.repeater.data.IDataProvider#model(java.lang.Object )
*/
public IModel model(Object object)
{
return new DetachableContactModel((Contact)object);
}
}
On 1/23/06,
Rick Reumann <[EMAIL PROTECTED]> wrote:
I was looking at the Library example and I noticed it uses a
PageableListView added to a PagingNavigator to display the List of
books. In this case all the books are being populated from a single
List.
How do you handle the cases where you need pagation, but each request
for a new page should go out o the server and get the new list. I
don't like the idea of having to store potentially thousands and
thousands of rows of data into a List just to create a sortable list.
(I understand one initial query is needed just to get the overall size
of the result set to create the page numbers, but that's a big
difference in overhead vs having to populate all the potential objects
from that query). To handle this in Wicket, would someone need to
write a new component to satisfy this business need or can it be done
using some standard iterating tag (similar to JSTL's forEach) and
straight HTML?
I'm new to using Wicket and still new to JSF as well, but I find the
whole component type of architecture a mixed blessing. For simple
stuff it's nice to have some out-of-the-box display features coded for
you, but when you end up having to customize, I often find a pain. I
know HTML and JSTL so coding my front end with simple JSTL and HTML is
easy. It's a shame that it seems like these component based frameworks
require you to work within the components to achieve what you want.
For example, in JSF I was wanting to display a bunch of stuff in divs
as I iterated over a collection. With standard JSTL and HMTL this is a
piece of cake, but in JSF I couldn't even find a component to let me
do this. Everyone said use the DataTable, but it didn't provide the
functionality I needed.
Thanks for any feedback.
--
Rick
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user