IMHO,
> ListView doesn't have sort order/filter info.
> That is something a that should be held in the model not in a
> component if it could i think.
> So setting a sort order would be:
> ((YoureModel)ListView.getModel().setSortOrder(xxx)
> at least in my eyes
That's what I meant. You need a reference to the listview to retrieve that
info wherever it may be if its not part of the model directly. Maybe
lv.getPage().get("whatever").getModel(). Don't know.
> > // not sure how these 2 would work of if they are
> necessary, but
> > maybe they can help to eliminate index based approach
> > serializable objecttoid(object obj);
> > object idtoobject(serializable id);
> >
Looks like we need imodel objecttomodel(object obj) instead of one of these,
need to implement it to see.
> for that we have a method on ListView:
> protected IModel getListItemModel(final IModel listViewModel,
> final int index)
That's exactly the problem.
1) you need to know to override this because it is not abstract. Unless you
are using a static list (and you almost never are - even pagedlist is not)
this will introduce an intermittent bug.
2) the default behaviour is based on list index which is not good for web
apps, thus the whole discussion of moving away from lists.
3) if I have multiple list views that work on the same object I need to
replicate the code that goes in here. Much easier to implemenet the model
interface and have this code factored out to there.
Igor
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user