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
