This is ultimately what I want. The Client object will have a collection of addresses, invoices and other objects. The user can view these objects and add new ones.
- I can create a form to create a new Client. - I can create a form to add an address to an existing Client (at least I think I can;) - I can't create a form to create a Client and add an Address at the same time. Right now I get bind errors if I add fields that aren't properties of the Client object itself. I suspect the solution lies with the property model. My current code references Client directly: IModel clientFormModel = new CompoundPropertyModel(new Client()); But I don't have a clear enough understanding of how Compound and Bound property models work. Thanks, Troy On Tue, 2005-13-09 at 09:15 -0700, Igor Vaynberg wrote: > I think a good way to handle this would be to use two pages. First page > would show the form for the client object properties along with properties > for a single address, the second page would allow the user to add additional > addresses to the client object they created in the previous step. Almost > like a two page wizard. > > -Igor > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:wicket-user- > > [EMAIL PROTECTED] On Behalf Of Troy MacNeil > > Sent: Tuesday, September 13, 2005 8:24 AM > > To: [email protected] > > Subject: [Wicket-user] Creating Embedded Object via Form > > > > This isn't the brightest question I've ever asked, I feel I'm missing > > very obvious. But I don't see an answer in the examples/wiki so here > > goes... > > > > I'm wondering how to handle. So for instance if I have a Client object > > which has one or more Address objects as members, how can I create a new > > client using a single form? > > > > I've looked at the cdapp example where Categories are linked to Albums, > > what I want is similar except I'd like to create Categories on the fly > > if necessary rather than select from a pre-instantiated list. > > > > <form wicket:id="form" action=""> > > Name: > > <input type="text" wicket:id="firstName"><br/> > > Street Address: > > <input type="text" wicket:id="address.streetAddress"><br/> > > <input type="submit" value="Add Client"/> > > </form> > > > > @Entity > > public class Client implements Comparable<Client> { > > protected Long Id; > > protected String Name; > > protected Address address; > > > > /*typical getters/setters below */ > > } > > > > @Entity > > public class Address implements Comparable<Address> { > > protected Long Id; > > protected String streetAddress; > > > > /*typical getters/setters below */ > > } > > > > Any help or pointers in the right direction greatly appreciated... > > > > Thanks, > > Troy > > > > Alluvion Development > > http://alluvioncorp.com > > > > > > ------------------------------------------------------- > > SF.Net email is Sponsored by the Better Software Conference & EXPO > > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > > Practices > > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > > _______________________________________________ > > Wicket-user mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Wicket-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/wicket-user > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
