You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ayodeji Aladejebi <al...@gmail.com> on 2007/08/01 23:58:51 UTC

What is IModel.getNestedModel useful for

Can someone explain to me the very essence of nested models (getNestedModel)
in IModel

i do always encounter getNestedModel() then i blindly always return null.
But am just curious as to why their is nested model (is it a way to chain
models?)

for example,

I have Entity A and Entity B

Then i have WebMarkupContainer aCont and WebMarkupContainer bCont

aCont is a parent of bCont

and then I have IModel aModel for aCont and IModel bModel for bCont

Now can i return bModel from getNestedModel of aModel (is that a working
scenario of getNestedModel())
?

Re: What is IModel.getNestedModel useful for

Posted by Johan Compagner <jc...@gmail.com>.
But people do use it for example

CompoundPropertyModel cpm = new CompoundPropertyModel(new
HibernateObjectModel(myDbObject));
cpm.getNestedModel().setId(xx);

But for this we have now IChainedModel so people who want to get the inner
model can do that by implementing that interface.

johan


On 8/2/07, Eelco Hillenius <ee...@gmail.com> wrote:
>
> On 8/1/07, Ayodeji Aladejebi <al...@gmail.com> wrote:
> > Can someone explain to me the very essence of nested models
> (getNestedModel)
> > in IModel
>
> We weren't that clear on it either, which is why we removed it from
> Wicket 1.3. :)
>
> > i do always encounter getNestedModel() then i blindly always return
> null.
> > But am just curious as to why their is nested model (is it a way to
> chain
> > models?)
>
> It was really only used by a couple of models, notably property models
> and string resource models, which can both work on other models. So
> you can let it return null without having to worry about it :)
>
> Eelco
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: What is IModel.getNestedModel useful for

Posted by Eelco Hillenius <ee...@gmail.com>.
On 8/1/07, Ayodeji Aladejebi <al...@gmail.com> wrote:
> Can someone explain to me the very essence of nested models (getNestedModel)
> in IModel

We weren't that clear on it either, which is why we removed it from
Wicket 1.3. :)

> i do always encounter getNestedModel() then i blindly always return null.
> But am just curious as to why their is nested model (is it a way to chain
> models?)

It was really only used by a couple of models, notably property models
and string resource models, which can both work on other models. So
you can let it return null without having to worry about it :)

Eelco

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