Hi Vineet,
public LoadableDetachableModel<YourClass> load(final Long xxx) {
LoadableDetachableModel<List<YourClass>> model = new
LoadableDetachableModel<List<YourClass>>() {
protected YourClass load() {
try {
List<YourClass> list = get your liste here( xxx )
return list
} catch (YourException e) {
}
}
};
return model;
}
IModel<List<YourClass>> model = load( x );
new ListView<YourClass>(id, model) ;
That is ok for a small list.
And if you have to handle large lists, you should use a Dataview with
DataProvider.
François
Le 16 févr. 2012 à 15:53, vineet semwal a écrit :
> sorry when i meant if you are going to retrieve a lot of data use dataview
>
> On Thu, Feb 16, 2012 at 8:17 PM, vineet semwal
> <[email protected]> wrote:
>> see listmodel
>>
>> btw if you have a big list ,use dataview
>>
>> On Thu, Feb 16, 2012 at 8:14 PM, atomix <[email protected]>
>> wrote:
>>> Hi all ,
>>>
>>> I'm using Cayenne as my database service...
>>>
>>> Now in a query return a List<Person>
>>>
>>> which I want to wrap a whole List in to ( so call)
>>> LoadableDetachableListModels to provide for a ListView, I'm also know that a
>>> DataProvider could do the same thing but did any one have write something
>>> like LoadableDetachableListModels to wrap a generic List and provide to a
>>> ListView...
>>>
>>> Please help!!
>>>
>>> I've read
>>> http://wicketinaction.com/2008/09/building-a-smart-entitymodel/
>>> .. so one entity is fine but
>>> but didn't know very clear what can be use for a List
>>>
>>> --
>>> View this message in context:
>>> http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModels-for-a-ListView-database-with-Cayenne-tp4394185p4394185.html
>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>
>>
>>
>> --
>> thank you,
>>
>> regards,
>> Vineet Semwal
>
>
>
> --
> thank you,
>
> regards,
> Vineet Semwal
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]