Marc,
The code you wrote is exactly what I am doing. The Order bean does have a
setDeliveries method (there would be compile errors if it didn't).
It's a baffling one!
Thanks,
Neil
----- Original Message -----
From: "Marc Portier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 25, 2004 5:14 AM
Subject: Re: Problem with repeater binding in CForm
>
>
> Neil Killick wrote:
> > As an aside, the following code works fine if put after the
form.save(order)
> > line:
> >
> > var address = new Packages.net.au.whirlwind.data.Address();
> > var deliveries = order.getDeliveries();
> > var model = form.getModel();
> > var deliveryModel = form.lookupWidget("deliveries/0");
> > address.setStreet(deliveryModel.lookupWidget("street").getValue());
> > address.setCity(deliveryModel.lookupWidget("city").getValue());
> > address.setSuburb(deliveryModel.lookupWidget("suburb").getValue());
> > address.setState(deliveryModel.lookupWidget("state").getValue());
> > address.setPostCode(deliveryModel.lookupWidget("postcode").getValue());
> >
> > This code grabs the values out of the form fine. So if this manual
approach
> > works, why doesn't the binding?
> >
>
> I think this is not the part that is causing the problem
> I would guess that reading from the form is ok, but setting the values
> to your bean is not
>
> the questions then are:
> 1/ how do you programmatically add the address to the deliveries
> is it this?
>
> var delivery = new Packages.net.au.whirlwind.data.Delivery()
> delivery.setAddress(address);
> delivereries.add(delivery);
>
> 2/ how do you programmatically add the deliveries to the order
> is it this?
>
> order.setDeliveries(deliveries) --> this method seems to be missing
> according to the error?
>
> regards,
> -marc=
>
> >
> > ----- Original Message -----
> > From: "Marc Portier" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, May 21, 2004 6:06 PM
> > Subject: Re: Problem with repeater binding in CForm
> >
> >
> >
> >>
> >>Neil Killick wrote:
> >>
> >>
> >>>Hi,
> >>>
> >>>
> >>
> >><snip what="sample snippets" />
> >>
> >>>I have also tried setting the parent-path to ".", again to no avail.
> >>>
> >>
> >>afaics that would be what you need, supposing the java call is
> >>order.getDelivery(index) and not
order.getDeliveries().getDelivery(index);
> >>
> >>
> >>>What am I doing wrong? Basically I don't get any errors, but
"Melbourne"
> >>>simply does not appear in the city field.
> >>>
> >>
> >>in fact with a wrong parent-path you wouldn't see any of the other
> >>fields of address either (were those working?)
> >>
> >>hm, you do have a getCity() on the address bean, right?
> >>try setting the lenient="false" on the binding, that would cause more
> >>errors if something isn't right
> >>
> >>HTH,
> >>-marc=
> >>--
> >>Marc Portier http://outerthought.org/
> >>Outerthought - Open Source, Java & XML Competence Support Center
> >>Read my weblog at http://blogs.cocoondev.org/mpo/
> >>[EMAIL PROTECTED] [EMAIL PROTECTED]
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> --
> Marc Portier http://outerthought.org/
> Outerthought - Open Source, Java & XML Competence Support Center
> Read my weblog at http://blogs.cocoondev.org/mpo/
> [EMAIL PROTECTED] [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]