You can provide an interface AND easily support collections because it is
very easy to wrap them. The constructor that takes a List interface can wrap
that into the internal interface, we shouldn't have to do this the other way
around.

There is also an impedence mismatch with using lists, webapps cannot depend
on the index of an object in a list to identify the object. ListView uses
the index to identity an element by default and you have to override it to
make it use the pk. I think this is a very bad practice as this is not an
obvious problem. Tapestry interfaces provide a reverse lookup method.

Igor


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Johan Compagner
> Sent: Friday, July 22, 2005 8:23 AM
> To: [email protected]
> Subject: Re: [Wicket-user] Newbie confused about PageableListView
> 
> so these 2 constructors:
> 
>     public PageableListView(final String id, final IModel model, int
> rowsPerPage)
>     {
>         super(id, model);
>         this.rowsPerPage = rowsPerPage;
>     }
> 
>     public PageableListView(final String id, final List list, 
> final int
> rowsPerPage)
>     {
>         super(id, list);
>         this.rowsPerPage = rowsPerPage;
>     }
> 
> should be replaced by one:
> 
>      public PageableListView(final String id, final 
> IPageableList list, int rowsPerPage)
>     {
>         super(id, new Model(list));
>         this.rowsPerPage = rowsPerPage;
>     }
> 
> 
> And maybe at specific places setModel() and the setting of the model 
> data should be checked so that there is always
> as IPageableList in a PageableListView class model.
> 
> would that the better and easier to understand then the current 
> implementation?
> And aren't we going to lose some things we can do now?
> 
> johan
> 
> 
> 
> 
> 
> Igor Vaynberg wrote:
> > This is the part of wicket I myself also do not like. I 
> think an interface
> > like that would make it easier and more precise to work 
> with wicket as
> > opposed to working with a paged list class, especially for 
> beginners. The
> > interface approach is more explicit ( the paged list 
> doesn't hide its
> > "windowed" behavior and you can retrieve the exact rows you 
> need easier )
> > and you can easily create a wrapper for a standard list 
> collection if you
> > need to, I think the current approach is an inside-out 
> approach. When I
> > started out with wicket I was struggling with this exact 
> issue as well as
> > the old impl of ChoiceList. I really prefer Tapestry's approach for
> > providing easy data accessing interfaces for components, it 
> lets the user
> > know exactly what methods need to be provided and it gives 
> a better view of
> > how the component works.
> >
> > Just my 2 cents.
> >
> > Igor
> >
> >
> >   
> >> -----Original Message-----
> >> From: [EMAIL PROTECTED] 
> >> [mailto:[EMAIL PROTECTED] On Behalf Of 
> >> Vjeran Marcinko
> >> Sent: Friday, July 22, 2005 4:40 AM
> >> To: [email protected]
> >> Subject: Re: [Wicket-user] Newbie confused about PageableListView
> >>
> >> ----- Original Message -----
> >> From: "Martijn Dashorst" <[EMAIL PROTECTED]>
> >> To: <[email protected]>
> >> Sent: Friday, July 22, 2005 10:09 AM
> >> Subject: Re: [Wicket-user] Newbie confused about PageableListView
> >>
> >>
> >>     
> >>> You can put two things into the ListView: a direct IList 
> >>>       
> >> implementation, 
> >>     
> >>> or a IModel backed list. The latter is the preferred way 
> in Wicket.
> >>>
> >>> The PageableList model is in the wicket-contrib-data 
> >>>       
> >> package. You can 
> >>     
> >>> download it from the wicket-stuff project. There you can find 
> >>> ISelectCountAndListAction, PageableList and 
> >>>       
> >> PersistentObjectModel. These 
> >>     
> >>> are what you are looking for.
> >>>
> >>> Wicket doesn't impose any persistence framework onto 
> >>>       
> >> anybody. That is why 
> >>     
> >>> we didn't put this in the core.
> >>>       
> >> OK, thanx, though I don't understand how would introduction 
> >> of some model 
> >> interface such as for eg.:
> >> interface PageableModel {
> >> int getTotalCount();
> >> List getRows(int offset, int limit);
> >> }
> >> introduce dependency upon any persistence framework? It 
> looks totaly 
> >> non-intrusive to me...
> >>
> >> -Vjeran
> >>
> >>
> >>
> >>
> >> -------------------------------------------------------
> >> 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
> >>
> >>
> >>
> >>     
> >
> >
> >
> >
> > -------------------------------------------------------
> > 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
> >
> >   
> 
> 
> -------------------------------------------------------
> 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
> 
> 
> 




-------------------------------------------------------
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

Reply via email to