> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Jonathan Locke
> Sent: Wednesday, August 10, 2005 2:01 PM
> To: [email protected]
> Subject: Re: [Wicket-user] DataView: IDataProvider.primaryKey() vote
>
>
> i guess i don't precisely understand what you're doing.
Check out DataView.onInternalBeginRequest(). Basically each DataItem needs
to have a unique id as a child of the dataview, currently this id comes from
IDataProvider.primaryKey() - this is an easy way to facilitate optimized
item removal - in the listview the id was the index.
>
> i also don't quite understand the choice of the word "Data" here...
> isn't this really a TableView
> or GridView more than a DataView? and if you keep the
> details of sorting and key/identity on the other side of the
> interface, it would work with things other than database objects...
The sorting is already on the other side. There are optional
interfaces/classes that facilitate this.
The "Data" word was the common denominator - why "List"View? Your are
generating tables and grids with that also. DataView is meant to be a
generic loop over data and it does work with things other then databases -
all you need is an iterator.
>
> btw, why does model() exist? couldn't iterator just produce
> a bunch of IModels? this seems nice to me...
>
> public interface TableView.IRange
> {
> Iterator<IModel> iterator(int first, int count);
> int size();
> boolean isSame(IModel a, IModel b)
> }
>
> how the thing produces IModels and how it determines equality
> are up to the user.
> this component could be used to replace listview
> functionality as well as working with databases... no?
Having model(Object o) is more convinient then having to wrap the iterator
you get from your datasource with a decorator.
isSame(imodel a, imodel b) makes it difficult to efficiently check for
existence since you have to loop over each element as opposed to doing a map
or a set lookup once you have the pk.
-Igor
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user