Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 42329 invoked from network); 23 Sep 2003 15:38:19 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 23 Sep 2003 15:38:19 -0000 Received: (qmail 93288 invoked by uid 500); 23 Sep 2003 15:38:10 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 92972 invoked by uid 500); 23 Sep 2003 15:38:08 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 92949 invoked from network); 23 Sep 2003 15:38:07 -0000 Received: from unknown (HELO zentrale.imkenberg.com) (212.48.115.35) by daedalus.apache.org with SMTP; 23 Sep 2003 15:38:07 -0000 Received: from mx.imkenberg.de (imkedvpdc [10.0.1.1]) by zentrale.imkenberg.com (Postfix) with ESMTP id C1DDF29401A; Tue, 23 Sep 2003 18:02:07 +0200 (CEST) Received: by imkedv_pdc with Internet Mail Service (5.5.2650.21) id ; Tue, 23 Sep 2003 17:26:24 +0200 Message-ID: From: Jianyu Wang To: dev@cocoon.apache.org Cc: mpo@outerthought.org Subject: AW: Help about how to use Repeater--bean binding Date: Tue, 23 Sep 2003 17:26:23 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N hello, Hugo, Marc I have tried the repeater with new resource from cvs, also I mean using string and long, but I get always the same exception. And I want to know whether the problem is from repeater handler or? Thanks=20 Jianyu=20 > -----Urspr=FCngliche Nachricht----- > Von: Marc Portier [SMTP:mpo@outerthought.org] > Gesendet am: Donnerstag, 18. September 2003 22:07 > An: dev@cocoon.apache.org > Betreff: Re: Help about how to use Repeater--bean binding >=20 >=20 >=20 > Hugo Burm wrote: >=20 > > Hello Jianyu, > >=20 > > Your unique-row-id (oid) must be a String. It is somewhere in the = Woody > > documentation and there is a comment in the sources that some = conversion > > routines should be added. The Long appears in your in = the > form > > definition, and in your AddressBean Java class. > >=20 > > Hugo > >=20 >=20 > Hugo, >=20 > I've created a fix for the mentioned TODO's and am updating the = samples=20 > to include the long datatype to show off this new support for = convertors=20 > on the row_ID field of the repeaters. >=20 > Maybe odd at first sight but the consequence of this is that if you = have=20 > a backend that is strongly typed (i.e. it produces Java Objects and=20 > beans rather then the typical Strings of the XML backend) then one = will=20 > NOT NEED TO DEFINE the convertor. >=20 > will check in right away, > Jianyu, could you verify that this is solving your problems? >=20 >=20 > regards, > -marc=3D >=20 > >=20 > >>-----Original Message----- > >>From: Jianyu Wang [mailto:Jianyu@Imkenberg.de] > >>Sent: Thursday, September 18, 2003 5:50 PM > >>To: dev@cocoon.apache.org > >>Subject: Help about how to use Repeater--bean binding > >> > >> > >>hi, > >>I have a problem when I use repeater to add a new row in the > >>form and later > >>save it into bean. I get the Exception like these: > >> > >>org.apache.commons.jxpath.JXPathException: Exception trying to > >>create xpath > >>addresses[1]; org.apache.cocoon.woody.binding.InsertBeanJXP > >>athBinding.access$000(Lorg/apache/cocoon/woody/binding/InsertBeanJ > >>XPathBindi > >>ng;)Ljava/lang/String; > >> at > >>org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath > >>(JXPathCon > >>textReferenceImpl.java:420) > >> at > >>org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath > >>(JXPathCon > >>textReferenceImpl.java:397) > >> at > >>org.apache.cocoon.woody.binding.RepeaterJXPathBinding.saveFormToMo > >>del(Repeat > >>erJXPathBinding.java:233) > >> at > >>org.apache.cocoon.woody.binding.ComposedJXPathBindingBase.saveForm > >>ToModel(Co > >>mposedJXPathBindingBase.java:108) > >> at > >>org.apache.cocoon.woody.binding.ContextJXPathBinding.saveFormToMod > >>el(Context > >>JXPathBinding.java:107) > >> at > >>org.apache.cocoon.woody.binding.JXPathBindingBase.saveFormToModel( > >>JXPathBind > >>ingBase.java:115) > >> > >> > >>my form defination is : > >> > >> > >> > >> > >> > >> > >> > >> Street > >> > >> > >> > >> > >> > >> > >> > >> > >> Select > >> > >> > >> > >> > >>and bind data like this: > >> > >> >> parent-path=3D"." > >> row-path=3D"addresses" > >> unique-row-id=3D"oid" > >> unique-path=3D"@oid" > >> > > >> > >> > >> > >> > >> > >> > >> > >> --> > >> > >> > >> > >> > >> > >> > >> >> classname=3D"com.imkenberg.bo.address.impl.AddressBean" > >> addmethod=3D"addAddress"/> > >> > >> > >> > >>And then the parent Bean has properties like this: > >>public abstract class DefaultPartyBean implements Party { > >> private Long oid; > >> private String email; > >> private String password; > >> protected List addresses =3D new LinkedList(); > >>and also methods. > >> public PartyAddress getAddress() > >> public void addAddress( PartyAddress address ) > >> public Iterator getAddressIterator() > >> public List getAddresses() > >> public void setAddresses( List addresses ) > >> > >>And the AddressBean is simplely like this: > >>public class AddressBean implements Address { > >> private Long oid; > >> private String city; > >> private String country; > >> private String houseNo; > >> private String zip; > >> private String street; > >> private long type; > >>with get and set methods. > >> > >>I am glad for your helping > >> > >>Thanks > >> > >>Jianyu > >> > >=20 > >=20 >=20 > --=20 > Marc Portier http://outerthought.org/ > Outerthought - Open Source, Java & XML Competence Support Center > Read my weblog at http://radio.weblogs.com/0116284/ > mpo@outerthought.org mpo@apache.org