wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From François Meillet <fm...@meillet.com>
Subject Re: LoadableDetachableModels for a ListView ( database with Cayenne)
Date Thu, 16 Feb 2012 15:09:40 GMT
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
> <vineetsemwal1982@gmail.com> wrote:
>> see listmodel
>> 
>> btw if you have a big list ,use dataview
>> 
>> On Thu, Feb 16, 2012 at 8:14 PM, atomix <say_i_love_you_4ever@yahoo.com> 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: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>> 
>> 
>> 
>> 
>> --
>> thank you,
>> 
>> regards,
>> Vineet Semwal
> 
> 
> 
> -- 
> thank you,
> 
> regards,
> Vineet Semwal
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message