then the only semidifficult part is the sorting - you need to come up with some utils that append the sort for you.

as far as paging it would translate directly to

session.setFirstResult(queryparam.getFirst()).setMaxResults( queryparam.getCount());

-Igor


On 7/18/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:
Well, I don't have DAOs in this particular project - it's an EJB3
project where I'm simply using SLSBs as DAOs....so I have the
EntityManager to work from and I should be able to bring the two
together to facilitate this...

This may be easier than I thought....

On 7/18/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
> yep, you have to code your daos with paging and sorting in mind, it cannot
> be slapped on as an afterthought.
>
> let me give you some clues
>
> see the attached QueryParam class, all my finder dao methods take it so that
> they can page/sort accordingly.
>
> hope it gets you started
>
>
> -Igor
>
>
>
>
> On 7/18/06, Vincent Jenks < [EMAIL PROTECTED] > wrote:
> > Currently I don't have anything like the ContactsDatabase class in
> > 'examples' - I'm just pulling a list of data and displaying in a
> > ListView....but it appears now that I'm browsing through I'm going to
> > have to create one and implement some of the methods like you have in
> > order to get paging/sorting.
> >
> > I'll play w/ it...it was just a little more than I expected once I
> > started digging into it.
> >
> > On 7/18/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > what could be simpler then the dataview? its just like a listview only
> > > instead of being fed off the list it is fed from the idataprovider.
> > >
> > > class mydataprovider implements idataprovider() {
> > >    iterator iterator(int first, int count) {
> > >       return mydao.findcontacts(first, count).iterator();
> > >    }
> > >
> > >     int size() {
> > >        return mydao.countcontacts();
> > >      }
> > >
> > >     model model(object o) {
> > >           Contact contact=(Contact)o;
> > >             return new ContactDetachableModel(contact);
> > >           //or return new Model(contact);
> > >     }
> > > }
> > >
> > > and that gets you paging, sorting is like this
> > >
> > > mydataprovider extends sortabledataprovider {
> > >      // ditto from above
> > >
> > >    iterator iterator(int first, int last) {
> > >          return mydao.findcontacts(first, last, getsort().getproperty(),
> > > getsort().getcount();
> > >    }
> > >
> > > }
> > >
> > >
> > > if you have more specific questions i will be happy to help you
> > >
> > > -Igor
> > >
> > >
> > >
> > >
> > >
> > > On 7/18/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:
> > > >
> > >  Is there something smaller & simpler out there I could refer to for
> > > sorting?  I've glanced at the DataView example a few times and once I
> > > start digging in it just seems unwieldly to me.  I'm simply trying to
> > >  sort a List of entities and the getContactsDB() stuff in the examples
> > > is a bit complicated to try and pick through.
> > >
> > > I gave paging a shot yesterday but quickly figured out it wouldn't be
> > > a snap to throw together like most wicket stuff I've done so
> > > far....I'm in a crunch or I'd spend more time banging my head on the
> > > table.
> > >
> > > I think if I just had a couple real-world examples I'd pick it up
> faster.
> > >
> > > How's that book coming along? :D
> > >
> > > Thanks!
> > >
> > >
> -------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > > opinions on IT & business topics through brief surveys -- and earn cash
> > >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > _______________________________________________
> > > Wicket-user mailing list
> > > Wicket-user@lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> > >
> > >
> -------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > > opinions on IT & business topics through brief surveys -- and earn cash
> > >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > >
> > > _______________________________________________
> > > Wicket-user mailing list
> > > Wicket-user@lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> > >
> > >
> >
> >
> -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > opinions on IT & business topics through brief surveys -- and earn cash
> >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to