Pass it two models.  Hold your models as private fields of the form
component.  Don't forget to override onDetach and detach the two models
yourself.

--
Jeremy Thomerson
http://www.wickettraining.com



On Wed, Mar 18, 2009 at 9:49 AM, Bram Vandoren <b...@bram.be> wrote:

> Hi,
> I use a custom FormComponent on a form:
> Form myForm = new Form("form");
> CompoundPropertyModel myModel = new CompoundPropertyModel(myOrder)
> myForm.setModel(myModel);
>
> The formcomponent has to set two properties of the
> CompoundPropertyModel of the form. At the moment I pass the complete
> CompoundPropertyModel to the FormComponent:
> myForm.add(new MyFormComponent("id", myModel));
>
> It looks terrible but it was the only solution I found. The
> FormComponent has access to the complete CompoundPropertyModel and I
> can't reuse the same FormComponent with other models. Any suggestions
> how to set 2 models in a FormComponent?
>
> Thanks,
> Bram.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to