add(new Label("label") {
protected IModel initModel() { return getParent().getModel(); }
});

-igor

On Dec 12, 2007 2:21 PM, jy <[EMAIL PROTECTED]> wrote:
> Hello.
>
> A newbie here.
> Is there a way for a child component to get access to the model added
> to the parent component?  I have two labels in the child component
> that use the same model field.  Since each label requires unique id, I
> can't use CompoundPropertyModel, can i?  I saw the example with
> BoundCompoundPropertyModel, but that needs access to the model.  So
> how can i get the model that was added to the parent?
>
> I stepped into child component in debugger.  Both getParent() and
> getModel() return null.
>
> Thanks in advance,
> J
>
> ---------------------------------------------------------------------
> 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]

Reply via email to