As long as you don't keep a reference to "doc", there's no need for a
model.

If you're pulling a lot of fields out of your "doc" instance (e.g. many
huge strings), your session size could still benefit from a LDM.

Regards

Sven

On Fri, 2010-12-03 at 13:51 -0800, Don wrote:
> Does it matter as long as I use it only in the c-tor(s)? I could have 
> something like this:
> 
> Document doc = model.getObject();
> add(new Label("doc_name", doc.getName()));
> add(new Label("doc_size", doc.getSize()));
>  
> But I could have also something else, with dropdowns etc.
> 
> --- On Fri, 12/3/10, James Carman <ja...@carmanconsulting.com> wrote:
> 
> > From: James Carman <ja...@carmanconsulting.com>
> > Subject: Re: Question on LoadableDetachableModel
> > To: dev@wicket.apache.org
> > Date: Friday, December 3, 2010, 11:43 PM
> > What do you do with "docModel" in
> > that constructor?
> > 
> > On Fri, Dec 3, 2010 at 4:15 PM, Don <donle...@yahoo.com>
> > wrote:
> > > Hi,
> > >
> > > I would suspect that having a class like below I
> > wouldnt really need to use a LoadableDetachableModel model
> > because I dont store it in some field of the class (or any
> > of the components used by it) so if the page gets stored
> > into session, that wouldnt bloat the session.
> > >
> > > Am I right in my thinking here, please?
> > >
> > > public class ResultPage extends WebPage {
> > >     // note no model stored as private fields of
> > some type
> > >     // DocumentModel model;
> > >
> > >     public ResultPage(DocumentModel docModel) {
> > >         // ...
> > >     }
> > > }
> > >
> > > Tks
> > >
> > >
> > >
> > >
> > 
> 
> 
>       


Reply via email to