At this point I would override/debug method updateModel() inside AddressPanel to see if model's object is modified by this method .
Just my 2 cents...
Yes, I think you are doing it "the Wicket way", but your snippet and
mine should work. Do you modify components' model somewhere else?
No, I don't think so. The page to which the component is added is constructed 
as follows:

CompoundPropertyModel<HomePage>  model = new 
CompoundPropertyModel<HomePage>(this);
Form<HomePage>  form = new Form<HomePage>("form", model);
form.add(new TextField<String>("person.firstname"));
form.add(new AdresPanel("person.adres"));

No other code modifies the model.

Which model do you get if you call getDefaultModel() inside oninitialize?
The result of getDefaultModel() is an instance of 
CompoundPropertyModel$AttachedCompoundPropertyModel, with owner set to the 
AdresPanel and with target set to a CompoundPropertyModel which in turn has 
target HomePage.

I noticed that upon initializing the model is set correctly. However when 
inspecting the model in onBeforeRender() during the submit request the target 
of the model of the AddressPanel.street model is set to HomePage.

Thanks for your reply. I've tried it but it still gave the same error.

However I also tried the following modified version of your idea:

In AddressPanel.java:

@Override
protected void onInitialize() {
        super.onInitialize();
         Object o = getDefaultModelObject();

         setDefaultModel(new CompoundPropertyModel(getDefaultModelObject()));
}

With the above code I can now load the page, also the
getDefaultModelObject() returns the correct Address instance. Unfortunately
upon submitting the form I get the same exception again ("No get method
defined for class: class foo.HomePage expression: street").
By the way: am I doing things "the Wicket way"? Is this how you would reuse
parts of a form in Wicket?


Best regards,

Bob


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


Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.



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



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

Reply via email to