[TYPO3-mvc] Complex array validation
Claus Due
claus at wildside.dk
Mon Feb 6 23:31:10 CET 2012
> I tried using the fluid form viewhelper and the FED version, but I get a 1323351482: Form/GroupViewHelper requires associated form object exception...
Hi Jacob,
Is {newInquiry} a proper object? For example, if the initial value is NULL you should do:
if ($newInquiry === NULL) {
$newInquiry = $this->objectManager->create($modelClassName);
}
...in the controller action. This is a limitation unfortunately - the fed:form.group VH does not work unless it has a proper object instance to work on.
Unfortunately there is no current example how to use the form group VH, so here is a quick example:
<fed:form.group amount="5" minimum="1" maximum="10" property="objectStorageProperty" iteration="iteration">
<fed:form.group.exclude>
This section does not get repeated but has all variables assigned by fed:form.group available. The selector
reads maxium/amount from parent VH arguments. We exclude this in order not to repeat the selector.
<fed:form.group.countSelector id="unique-dom-id" />
</fed:form.group.exclude>
<h6>Group {iteration.cycle}</h6>
<f:form.textfield property="{property.childPropertyName.name}" value="{property.childPropertyName.value}" />
</fed:form.group>
This is off the top of my head so I hope it works. Note that {property} is a reserved variable name and contains .name and .value of each of the properties on the objects in the objectstorage, for example if your property is called "name", you should use {property.name.name} and {property.name.value}.
--
Cheers,
Claus
http://fedext.net
More information about the TYPO3-project-typo3v4mvc
mailing list