Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 20104 invoked from network); 13 Mar 2005 19:25:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 13 Mar 2005 19:25:50 -0000 Received: (qmail 49661 invoked by uid 500); 13 Mar 2005 19:25:49 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 49622 invoked by uid 500); 13 Mar 2005 19:25:48 -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 49609 invoked by uid 99); 13 Mar 2005 19:25:48 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from um0007.unimaas.nl (HELO um0007.unimaas.nl) (137.120.1.7) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 13 Mar 2005 11:25:48 -0800 Received: by um0007.unimaas.nl (Postfix, from userid 3003) id 6BF15C055; Sun, 13 Mar 2005 20:25:45 +0100 (CET) Received: from um-mail0139.unimaas.nl (um-mail0139.unimaas.nl [137.120.1.139]) by um0007.unimaas.nl (Postfix) with ESMTP id 39B17C069; Sun, 13 Mar 2005 20:25:43 +0100 (CET) Received: from um-mail0136.unimaas.nl ([137.120.1.136]) by um-mail0139.unimaas.nl with Microsoft SMTPSVC(6.0.3790.211); Sun, 13 Mar 2005 20:25:52 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: CForms Binding - Cross Referenced Data (duplicate of post on users) Date: Sun, 13 Mar 2005 20:25:50 +0100 Message-ID: <329A68716B57D54E8D39FD3F8A4A84DF016A4508@um-mail0136.unimaas.nl> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: CForms Binding - Cross Referenced Data (duplicate of post on users) Thread-Index: AcUn7z57O7u7KcBtTqG8Pj8VUIIxWQABFyOwAAM9XlAAAGvWEA== From: "Linden H van der (MI)" To: , X-OriginalArrivalTime: 13 Mar 2005 19:25:52.0088 (UTC) FILETIME=[78284D80:01C52802] X-UM-Spam-DCC: sonic.net: um0007 1156; Body=1 Fuz1=1 Fuz2=1 X-UM-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on um0007.unimaas.nl X-UM-Spam-Level: X-UM-Spam-Status: No, score=-4.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, MAILTO_TO_REMOVE autolearn=ham version=3.0.1 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N You could make a multipage form if necessary. Also have a look at the samples in the forms block. I think the dreamteam sample and the dynamic repeater sample demonstrate what you are looking for. HTH. Bye, Helma > -----Original Message----- > From: Ben Pope [mailto:ben_pope@REMOVE_MEhotmail.com]=20 > Sent: Sunday, 13 March 2005 20:22 > To: dev@cocoon.apache.org > Subject: RE: CForms Binding - Cross Referenced Data=20 > (duplicate of post on users) >=20 >=20 > Linden H van der (MI) wrote: > > Hi, > >=20 > > Just a quick response.=20 > >=20 > > What you describe here are two entities: rooms and persons.=20 > > It is much more common sense to treat them separately, i.e. a=20 > > list for editing persons (just a repeater) and a list for=20 > > editing rooms (simple list?) and finally, maybe a doubleList=20 > > for adding persons to a room. >=20 > Quite possibly, but I'm recreating some paper forms and want=20 > the user to be > able to enter the information as quicky as possible using my system. >=20 > Essentially all the peoples names and ids are predefined=20 > (there will no > doubt be a form to enter those people, too), but can be=20 > modified at any > point. More fields will be added to the people using this=20 > form (lets say; > age, height, favourite colour). >=20 > Unfortunately it has to be done this way. >=20 > Thanks for your reply. >=20 >=20 > Does anybody know how I can use fb:javascript (or flow, if=20 > not) to grab each > id specified in the repeater and replace people elements=20 > inside of the room > with the appropriate idrefs? >=20 > Cheers, >=20 > Ben Pope >=20 >=20 >=20 >=20 >=20 > > > -----Original Message----- > > > From: Ben Pope [mailto:ben_pope@REMOVE_MEhotmail.com] > > > Sent: Sunday, 13 March 2005 18:12 > > > To: dev@cocoon.apache.org > > > Subject: CForms Binding - Cross Referenced Data (duplicate=20 > > of post on=20 > > > users) > > >=20 > > >=20 > > > Hi, > > >=20 > > > First of, sorry for the post here, but I've asked a few=20 > > times on users=20 > > > and not had this solved, so I'm gonna cross my fingers and=20 > > post here: > > >=20 > > > This is something I've been struggling with, on and off,=20 > > for some time=20 > > > now. > > >=20 > > > Assume I have some data as follows: > > >=20 > > > > > > > > > > > > Me > > > > > > > > > You > > > > > > > > > Him > > > > > > > > > > > > > > > Lounge > > > > > > > > > > > > > > > Kitchen > > > > > > > > > > > > > > >=20 > > > That describes a list of people which are in a particular=20 > > room, so Me=20 > > > and You are in the Lounge and Him is in the Kitchen. > > >=20 > > > I want to have a form that displays, for a given room, a=20 > > list of the=20 > > > people in it. > > >=20 > > > A repeater is obviously the first choice, but there are a few=20 > > > counter-intuitive thingsd going on: > > >=20 > > > I need to be able to modify the name of the person. =20 > Simply running=20 > > > the repeater over the rooms is not enough. > > >=20 > > > Adding a row needs to add an rooms/room/person with an idref > > > - I'll then use > > > client side javascript and XMLHTTP to allow the user to select a=20 > > > person (by > > > id) to fit in the space, as all the people are predefined. =20 > > I do not=20 > > > want to have the repeater add /people/persons. > > >=20 > > > I've toyed with a few ideas: > > >=20 > > > id is passed in as a parameter, and this code is actually in a=20 > > > stylesheet - but ignore that for now. > > >=20 > > > > parent-path=3D"/project/rooms/room[@id=3D{$id}]" > > > = row-path=3D"/project/people/person[@id=3D/project/rooms/room[@id=3D{ > > > $id}]/person/@ > > > idref]"> > > >=20 > > > This "solution" has the result of being perfect for load. =20 > > > However, when I > > > save it, it breaks, because I can't have an xpath predicate. =20 > > > So what do I > > > set the row-path-insert to? > > >=20 > > > If I set row-path-insert=3D"/project/people/person" and bind the = id=20 > > > (which is > > > fb:identity) in both directions, /project/people/ ends up=20 > > correct, but=20 > > > /project/rooms/room/ doesn't get updated. > > >=20 > > > I've tried > > > > > > > > > > > > > > >=20 > > > But then I get a new node in both /rooms/room[@id=3D'0']/ which is = > > > correct, and another node created in /project/people/=20 > which is the=20 > > > usual binding for person and is a copy of the existing one. This=20 > > > doesn't seem correct to me. > > >=20 > > > Hmm, I've had a little play with fb:javascript but I don't=20 > > know what=20 > > > I'm doing... Ideally I would remove all the=20 > > > /rooms/room[@id=3D'x']/person fields and repopulate with the=20 > > list of ids=20 > > > in the repeater. I can't seem to work out the correct=20 > > APIs, it always=20 > > > says that such and such method doesn't exist > > > - can anybody point me in the right direction? > > >=20 > > > I've toyed with the idea of having two repeaters, and=20 > updating one=20 > > > from the other but it sounds like a recipe for disaster. > > >=20 > > > Another idea was to have a play around with it in flow, but=20 > > I suspect=20 > > > I'd end up with exactly the same problems I have using=20 > > fb:javascript,=20 > > > with the disadvantage of distributing the binding code. > > >=20 > > > Any help is much appreciated, I'm confused by the number=20 > of options=20 > > > and multitude of interfaces. > > >=20 > > > I can't be the only person working with cross-referenced=20 > data! I'm=20 > > > either missing something or the repeater just doesn't=20 > > understand this=20 > > > construct - I wonder if Sylvain has any ideas on this. > > >=20 > > > I also started writing my own Repeater (well I copied the=20 > existing=20 > > > one, renamed it, changed some of it's parameters and=20 > managed to get=20 > > > Cforms to use it), but running through with eclipse in debug mode=20 > > > doesn't really throw any light on the subject - it's all=20 > > too confusing=20 > > > for me. > > >=20 > > > Heeeelp! > > >=20 > > > Ben > > >=20 > >=20 >=20