what does the panel have to do with the property in a CPM?

It is the things that are in the panel that want to use the CPM that needs the right properties.
But are you saying you want to make a somwhat generic FormPanel with textfields that must map on
specific properties on a random CPM?

You could use the BoundedCPM for this and bind the textfields in the panel to the right dataprovider.

johan


On 5/3/06, Rüdiger Schulz <[EMAIL PROTECTED]> wrote:
Hello fellow Wicket users,

I have a general question regarding models and using them with forms
and custom panels.

In my example I have a form with a CompoundPropertyModel and several
standard TextFields etc., each one therefore being mapped to a
Property of the Bean passed to the CPM. So far so good :)

Now I want to create "Form Panels", meaning a Panel with one or more
FormComponents, which are then mapped together to a single property.
In this case it is a TextField and a corresponding DatePicker. I'd
like to put this in a Panel, so that I can reuse it easily on several
forms, and also being mapped to different Beans and Properties.

So, without the Panel this is no problem; I just set the ID of the
TextField to the name of the property, and the mapping is done via the
CPM. But this is not possible when I put this in a Panel, since in the
HTML for the Panel, the id must always be the same.

So, what needs to be done in the panel, that the TextField is always
mapped to the right Property of the enclosing form? Should I just set
the Model of the field to the one of the Panel?

And to make this more general:
How do I do this for a Panel with say two TextFields, whose contents
should be concatenated and put into a single property, again via using
a form with a CPM.

I'd like to have it work like this in the form:
add(new MyFormPanel("propertyName"));

Is this possible?

Any hints are welcome :-)

I have already read the Wiki-articles on Models
(http://www.wicket-wiki.org.uk/wiki/index.php/Using_Models and
http://www.wicket-wiki.org.uk/wiki/index.php/Models), but couldn't
find this out. I think I'm just a small step away - I already found
out about Model chaining, but got this to work only with a Panel being
mapped to a Property, which is iteself a Bean, and not a Date or
String as in my case :(



--
greetings from Berlin,

Rüdiger Schulz



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to