No problem. Good to know people like to use Wicket for their hobby too! :)

Eelco

On 5/26/06, Florin Gheorghies <[EMAIL PROTECTED]> wrote:
Thanks for the reply. Between my job (construction), two kids (3 and 1) and
my wife's computer use restrictions, I only get about 2 hours a week for
wicket. I really am grateful for the help.

Florin

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Eelco
Hillenius
Sent: Friday, May 26, 2006 9:26 PM
To: [email protected]
Subject: Re: [Wicket-user] ON FORMS: How do I use get to edit an Object's
property when it is another complex object?

For clarity:

The ids of the form components only matters when you use a
CompoundPropertyModel, so might just as well have written the second
example like:

static class MyForm extends Form {

 public MyForm(String id, Customer customer)  {
   super(id);
   add(new TextField("foo", new PropertyModel(customer, "name"));
   add(new TextField("bar", new
PropertyModel(customer, "address.streetName"));
 }
}

or

static class MyForm extends Form {

 public MyForm(String id, Customer customer)  {
   super(id);
   add(new TextField("foo", new PropertyModel(customer, "name"));
   add(new TextField("bar", new
PropertyModel(customer.getAddress(), "streetName"));
 }
}

Eelco

On 5/26/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> static class MyForm extends Form {
>
>   public MyForm(String id, Customer customer)  { /* even better is to
> have a model that produces your customer object */
>     super(id);
>     setModel(new CompoundPropertyModel(customer);
>     add(new TextField("name"); // customer name
>     add(new TextField("address.streetName"); // address' street name
>   }
> }
>
> or
>
> static class MyForm extends Form {
>
>   public MyForm(String id, Customer customer)  {
>     super(id);
>     add(new TextField("name", new PropertyModel(customer, "name"));
>     add(new TextField("address.streetName", new
> PropertyModel(customer, "address.streetName"));
>   }
> }
>
> Or whatever alternative you like.
>
> Eelco
>
> On 5/26/06, Florin Gheorghies <[EMAIL PROTECTED]> wrote:
> >
> > Customer {
> >         String name;
> >         Address address;
> > }
> >
> > Address {
> >         String streetName;
> >         String zip;
> > }
> >
> > I'd like to build a form that edits both the Customer.name and
> > Custmer.address.streetName;
> >
> >
> > Thanks.
> >
> >
> >
> > -------------------------------------------------------
> > All the advantages of Linux Managed Hosting--Without the Cost and Risk!
> > Fully trained technicians. The highest number of Red Hat certifications
in
> > the hosting industry. Fanatical Support. Click to learn more
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to