cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Cocoon 2.1.11, repeater binding and JavaScript
Date Thu, 26 Jun 2008 16:27:08 GMT
Dear Mailing List,

I'm faced with a repeater binding issue and after many hours of googling and testing I don't
really know how to go on...

I'm using CForms with the binding framework and JavaScript for flow and objects (representing
the records) to edit my DB-records. After some experimenting this works very well.
Now I'm trying to use a repeater to directly edit child-recs of a record. In the respective
Javascript-Object (representing the parent-rec) I use a property "this.attribute = new java.util.Vector();"
which holds the child-record-objects.
The children are shown correctly in the repeating widgets and the (changed) values are saved
back to the JS-objects as expected.

the binding config:
<fb:context xmlns:fb=""
	<fb:value id="probenteil_id" path="probenteil_id"/>
	<fb:value id="datum" path="datum"/>
	<fb:value id="bemerkung" path="bemerkung"/>

	<!-- attribute repeater -->
	<fb:repeater id="attribute" parent-path="." row-path="attribute">
			<fb:value id="row_id" path="id">
				<fd:convertor datatype="integer"/>
			<fb:value id="attribut_id" path="attribut_id"/>
			<fb:value id="wert_dec" path="@wert_dec"/>
			<fb:insert-bean addmethod="add"/>

The Problem:
when I add a row in the repeater (in this case the 4th), fill in the required values and submit
the form I get
"Cannot create a relative context for a non-existent node: /.[@name='attribute'][4]"
... OK, as the action for on-insert-row is commented out, but when I use it (remove the comment)
I get
"java.lang.NoSuchMethodException: org.mozilla.javascript.NativeObject.add()".

My thought was, that the insert-bean in on-insert-row will call the method {addmethod} of
the object what is bound to the repeater widget (in my case the property 'attribute' what
holds an instance of java.util.Vector)

I would be very grateful if you can help me to solve (and/or understand) what's wrong here!

Many thanks!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message