but you would still have to access the database twice. once to retrieve the total count and once to retrieve the page. true idataprovider makes it difficult to aquire all this in a single transaction, but what would you propose a signature/return type of the method call would be to acquire both?

also, usually select queries are not ran inside transactions so i have never thought it would be such a big concern.

im open to discussing this so please go ahead.

-Igor


On 1/12/06, Ingram Chen <[EMAIL PROTECTED]> wrote:
I also have same problem...  IDataProvider has two callback methods:
iterator() and size(), this force subclass always access database twice every request. And even worse, I can not combine these two access within single transaction if integrating with Spring.

I use technique as karthik mentioned in first post to solve this issue before, but I can't do it now. The only thing I can do is tweaking something in onBeginRequest().

I hope IDataProvider can provide "single" hook instead of two hooks.



On 1/13/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
the dataprovider is quieried every request for the data, so manipulate the data in the object that the idataprovider represents instead of changing the idataprovider directly. will that do? if not i can add a setDataProvider() method, but i thought it would be unnecessary.

-Igor



On 1/12/06, karthik Guru < [EMAIL PROTECTED]> wrote:
Hi Igor,
 
DataView in wicket 1.2 does'nt accept a Model and instead accepts only IDataProvider. I need to change the contents of the ListDataProvider dynamically. Earlier (1.1) I c'd get this working through Model.getObject( ) where i used to return a different ListDataProvider.
 
DataViewBase.internalGetDataProvider( ) is final so am unable to override it in my DataView derived class.
What do you think is the best way to accomplish this now?
 
thanks
karthik

 
On 1/4/06, Igor Vaynberg <[EMAIL PROTECTED] > wrote:
this is the right approach. this is exactly why the listview either takes a collection instance or an imodel instance instead.

-Igor



On 1/3/06, karthik Guru <[EMAIL PROTECTED] > wrote:
I'm want to be able to supply the ListView with a IModel that tells it how to get to the list. I'm not in a position to supply the List at the time of construction. The ListView needs to fetch it while rendering. So i supplied a Model configured with the "List source" with its getObject(Component) call overriden (where I fetch the list ). Ofcourse it works just fine!
My question is - Is this an acceptable way of using a Model / is there a better delegation model built in that I can use to do such things ? 
 
thanks,
karthik
 






--
Ingram Chen
Java [EMAIL PROTECTED]
Institue of BioMedical Sciences Academia Sinica Taiwan
blog: http://www.javaworld.com.tw/roller/page/ingramchen

Reply via email to