I am trying to create Panels that represent each of my domain objects i.e.
Address, Name, Referee (Contains Name and Address) etc..

I then have a CompoundPropertyModel over a value object which represents the
entire form. In this I want to map its properties (and sub properties etc)..
I am having trouble finding ways of nesting models or a single model to get
the desired behaviour..

This is the hierarchy of Components I want is

MyForm
-->NamePanel
-->AddressPanel
-->RefereePanel
---->NamePanel
---->RefereePanel
---->email:TextField
---->telephone:TextField

The panels contain simple TextFields (not shown)

The hierarchy of value objects is

-->MyFormVO
---->name:NameDO
---->address:AddressDO
---->referee:RefereeDO
------>NameDO
------>AddressDO

What would be the most effective nesting of models?

As the panels need to be reusable and modifiable at a later date I don't
want to specify any properties in parents or children in pages/forms..

I was hoping that the component names would drill down depending on nesting
but it seems that it is trying to find the expression "title" rather than
"name.title" or "referee.name.title" which is what I would hope nesting a
panels inside the form.

Is there a model that does this for nested panels?












                public MainForm(final String componentName) {
                        super(componentName, new CompoundPropertyModel(new 
FormValueObject()));
...

                        add(new NamePanel("name", new PropertyModel(getModel(), 
"name")));
                        add(new AddressPanel("currentAddress", new 
PropertyModel(getModel(),
"currentAddress")));

In the name and address panels I have used a similar approach..





-- 
View this message in context: 
http://www.nabble.com/Resuable-Panels-and-Model-nesting-tf3675608.html#a10270774
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to