[FLOW3-general] Embed forms for IRRE like editing?

Tolleiv Nietsch info at tolleiv.de
Mon Mar 28 00:17:58 CEST 2011


Hi,

I'm currently struggeling a bit, setting up forms for editing related 
objects at the same time.

So the "setup" is a basic "OneToMany" relation between "Foo" and "Bar" 
classes. When editing "Foo" I'd like to update the properties of the related 
"Bar" objects.

My first attempt looks like:
<f:form method="post" action="update" name="foo" object="{foo}">
	...
	<f:form.textbox property="property" />
	...
	<f:for each="{foo.bars}" as="{bar}">
		<f:form.textbox property="bar.property" />
	</f:for>
	<f:form.submit value="Update" />
</f:form>

That renders the bar.property as: "<input type="text" value="" 
name="foo[bar][property]">" which can't be right.

The next attempt was:
                ...
	<f:for each="{foo.bars}" as="{bar}" key="id">
		<f:form.textbox property="bar.{id}.property" />
	</f:for>
                ...
Which renders something "more" convenient "<input type="text" value="" 
name="foo[bar][0][property]">"
But submitting that back to the controller will break with a "#1296763314: 
Could not transform to object" exception :(

Any ideas? Thanks for your help :)

Cheers,
Tolleiv
 



More information about the FLOW3-general mailing list