No because the MyTextField will not be able to init its model based on the
parent CompoundPropertyModel since it don't know him yet. Only after exit
the form.add call MyTextField.getModel will work as expected.
If MyTextField invokes getModel inside the onInitialize it will work fine,
since at this point since an path exists from this component to the page.


On Thu, Jan 27, 2011 at 10:59 AM, Brown, Berlin [GCG-PFS] <
berlin.br...@primerica.com> wrote:

> How does the compound property model work in these instances:
>
> If I do (pseudo code):
>
> Form form = new Form ( new CompoundPropertyModel(someObject))
>
> form.add (new MyTextField("someFieldFromObject");
>
> ...
>
> public class MyTextField {
>
>   public MyTextField() {
>      super(id);
>      getModel()  ???? <----- will this return an object?
>      getModelObject() ???? <------ will this return an object?
>   }
> }
>
> Basically, when is the model object and model bound to a component that
> uses the compound property model.
>
> Berlin Brown
>



-- 
Pedro Henrique Oliveira dos Santos

Reply via email to