cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Pope" <nos...@hotmail.com>
Subject RE: CForms, Binding, Flowscript (Cocoon 2.1.5)
Date Mon, 19 Jul 2004 22:41:49 GMT
Hi Vilya,

I appreciate your help - you got it working!

I changed my form binding file to:

<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
xmlns:fd="http://apache.org/cocoon/forms/1.0#definition" path="/data">
	<fb:repeater id="reports" parent-path="reports" row-path="report" >
		<fb:identity>
			<fb:value id="number" path="number"/>
		</fb:identity>
		<fb:on-bind>
			<fb:value id="number" path="number"/>
			<fb:value id="date" path="date">
				<fd:convertor datatype="date"/>
			</fb:value>
		</fb:on-bind>
		<fb:on-insert-row>
			<fb:insert-node>
				<report id="" row-state="new">
					<number/>
					<date/>
				</report>
			</fb:insert-node>
		</fb:on-insert-row>
	</fb:repeater>
</fb:context>

As you suggested (and included a bit of path cleaning up)

And it works,

Nice one.

Cheers!

Ben.




-----Original Message-----
From: Vilya Harvey [mailto:vilya@lineone.net] 
Sent: 19 July 2004 12:01
To: users@cocoon.apache.org
Subject: Re: CForms, Binding, Flowscript (Cocoon 2.1.5)

Ben Pope wrote:
> I've been following the blocks/forms/XML Binding example without 
> complete success.  It will bind quite happily to the CForms, it will 
> map changes back to the XML, but only when the row "number" already
exists.

I've only had a quick look through your example, but I think you need to add
an <fb:on-insert-row> element to your binding. Have a look at the binding
framework documentation
(http://cocoon.apache.org/2.1/userdocs/forms/binding.html#fb%3Arepeater) for
more info on how to use it.

Hope that helps,
Vil.
-- 
             __
    o|   _. /  \|o._  _  _ ._  _  ._  _ _|_
\/ ||\/(_|| (|/||| |(/_(_)| |(/_o| |(/_ |_
      /     \__
http://website.lineone.net/~vilya

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message