cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Killick" <>
Subject Problem with repeater binding in CForm
Date Fri, 21 May 2004 02:55:29 GMT

I'm having problems binding my JavaBean hierarchy to a CFORM. I am setting a default city
in my Address bean and it is not being mapped into the form once the form is loaded.

I have an Order bean which holds a collection (ArrayList) of Delivery beans. Each Delivery
bean holds an Address bean. I am just trying to set up one Delivery bean to map into the form
(i.e. I'm not adding rows, I'm just trying to get the first address to work).

I would really appreciate any help on this. Basically my binding is exactly the same as the
contact details example that ships with Cocoon (<cocoon-home>\src\blocks\forms\samples\forms\form2_bind_xml)
except I am going down to a deeper path (i.e. delivery/address). My binding is set up in the

function getOrderDeliveryForm() {
 var form = new Form("forms/orderDelivery.xml");
 return form; 

Here is the other pertinent code and xml:


var form = getOrderDeliveryForm();
var order = new;  
var delivery = new;  
var address = new;

form.showForm( "form-orderDelivery", {"view": param} );;


<?xml version="1.0"?>
<fd:form xmlns:fd="" xmlns:i18n="">
  <fd:repeater id="deliveries" initial-size="1">
   <fd:hint>this is a hint</fd:hint>
   <fd:help>this is some help</fd:help>
    <fd:output id="id">
          <fd:datatype base="long"/>
    <fd:field id="street" required="false">
     <fd:datatype base="string"/>
    <fd:field id="suburb" required="false">
     <fd:datatype base="string"/>
    <fd:field id="city" required="false">
     <fd:datatype base="string"/>
    <fd:field id="state" required="false">
     <fd:datatype base="string"/>
    <fd:field id="postcode" required="false">
     <fd:datatype base="string">
      <fd:converter type="plain"/>
       optionswidget = event.source.lookupWidget("../options");       
             optionswidget.setSelectionList( h.calcDeliveryOption(), "id", "name" );
    <fd:field id="country" required="false">
     <fd:datatype base="string"/>
    <fd:field id="options" required="false">
     <fd:datatype base="string"/>
      <fd:item value="">
       <fd:label>Select a postcode first</fd:label>
    <fd:row-action id="delivery-remove" action-command="delete">
  <fd:repeater-action id="delivery-add" action-command="add-row" repeater="delivery">
   <fd:label>add address</fd:label>


<?xml version="1.0"?>
<fb:context xmlns:fb=""
xmlns:fd="" path="/">
 <fb:repeater id="deliveries" parent-path="deliveries" row-path="delivery">
      <fb:value id="id" path="@id"/>
   <fb:value id="street" path="address/street"/>
   <fb:value id="suburb" path="address/suburb"/>
   <fb:value id="city" path="address/city"/>
   <fb:value id="state" path="address/state"/>
   <fb:value id="postcode" path="address/postCode"/>
   <fb:value id="country" path="address/country"/>
   <fb:value id="options" path="method"/>

I have also tried setting the parent-path to ".", again to no avail.

What am I doing wrong? Basically I don't get any errors, but "Melbourne" simply does not appear
in the city field.

Thanks in advance.

Neil Killick
Public Image
Creative Strategy & Production 
for Print, Online & Broadcast Media

Public Image Software
The SONART family of 
Management Information Systems
for the creative industries

Melbourne Studios:
Telephone +61 3 9650 0650
Facsimile +61 3 9650 0770

View raw message