no, the model() is there to wrap every object returned from the iterator() call in its own (detachable) model. this model is used in Item components which represent a rows inside a dataview.

-Igor


On 4/5/06, Frank Silbermann <[EMAIL PROTECTED]> wrote:
Me:
>> I suppose the usual approach is to trigger the download of
>> IDataProvider's data via the event handler of the submit button.
>> That way, the data would be available for both "Iterator
>> IDataProvider.iterate(first, count)" and "int IDataProvider.size()".

Eelco Hillenius Sent: Tuesday, April 04, 2006 5:58 PM:
>
> It's the responsibility of the model(s). Components may rely on models
> being properly initialized and available whenever they want to access
> them. Model implementations may or may implement detachable behavior,
> caching etc.


Perhaps the method "IModel IDataProvider.model(Object)" has something to
do with this.  How is this method to be used?


>> However, I do not have a single submit button - I have various sets
of
>> radio-buttons and a change to any one causes an immediate postback.
I do
>> not want to code an event handler for each one of them; I'd rather
put my
>> database query in a method that is called before the page is rendered
>> _regardless_ of the reason.  Can you suggest a suitable method?

Eelco:
> So, make that part of your model's implementation. Look at for example
> LoadableDetachableModel for ideas, or you can use the implementation
> directly too if you want.

I am guessing that the input to "IModel IDataProvider.model(Object)" is
some object in the session that provides the information needed for the
database download.  Any IDataProvider method that needs database data,
e.g. "int count()" and "Iterator iterate(first,count)" must call "IModel
IDataProvider.getModel(Object)" to get the wrapper, and then ask that
wrapper to provide the database-filled result.

In this way, whichever IDataProvider method needs the database data
first is the one that causes the database refresh.

Is that the idea?



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to