here are just some thoughts _off the top of my head_

maybe instead of doing this: ModelChange:68+ what we need to do is make our cloning even smarter.

as we are cloning the model we need ot check if the internal state contains an instance of IModel - when we see that we need to traverse the upwords hierarchy of the component and check if one of them has this model instance, and if it does we dont need to clone but write in that we need to set it from that component.

i dont think it solves 100% usecases, but it will take a good chunk out

does this make sense? i have a migraine so im trying ot stay away from anything that requires thinking as it makes the pain worse :)P


-Igor


On 9/16/06, Erik Brakkee <[EMAIL PROTECTED]> wrote:
Hi,


I am interesting in writing components for editing domain objects. An example of such an object is Employee which has and Address and several other attributes. Also, I have Employer, which also has an Address. Now, if I want to create a component for an address that provide a part of the form, then I would like to be able to write it independent of whether it is the Employer's address or the Employee's address. In other words, I want to see an HTML template of the form:

     <tr> <td>Streeet:</td><td><input wicket:id="street" type="text"/></td></tr>
     .... other fields in a similar way...

In other words, I don't want to write wicket:id="address.street" because that would mean that the Address always has to be obtained from a model object using getAddress(). In other words, I would lose the ability to edit an address on its own or edit addresses that are retrieved by a different getter.

A first solution to solve this is to construct my own AddresPanel (extends Panel) with a reference to an Address object. The panel also creates its own CompoundPropertyModel based on the address. I tried this, and it works, but then again, back button support will be broken because when an old version of the page is requested, the CompoundPropertyModel of the Employer/Employee and Address will have different objects since they made their own copies.

It there a way in wicket 1 to share models? I was looking through the wicket 2 code and there seems to be something about shared models there. So what would be the wicket 1 way and what would be the wicket 2 way for doing this properly?

Cheers
  Erik


-------------------------------------------------------------------------
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?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
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?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to