[FLOW3-general] Nested Forms

Carsten Bleicker carsten at bleicker.de
Mon May 21 16:38:00 CEST 2012


i dont know if its possible to create nested forms by default just using a default fieldset for a model.
so i wrote a viewhelper wich allows to use partials of fields with 1st level propertynames.
resulting names of the inputs will be appendet with needed namespace of the namespace of f.e.
formObjectName from the f:form viewHelper.

maybe someone can take a look or trying it out and say me what you think about it?
many many thanks!

https://gist.github.com/2762421

carsten



Am 21.05.2012 um 11:55 schrieb Carsten Bleicker:

> i have 2 models and just wrote for any model a fluid partial.
> each partial has <f:input.textfield property="title" />
> object1 is owning object2 on property "subObject".
> 
> 
> i want to use these partial now in a nested form:
> <f:form object="{myObject}" objectName="newObject1">
> 	<f:render partial="object1" />
> 	<f:render partial="object2" />
> </f:form>
> 
> resulting name for object2 is name="newObject1[title]" wich should be name="newObject1[subObject][title]"
> because i want to reuse the partial wich contains just fields for a model in different nested forms.
> is it possible to do this just by adding arguments to the partialViewHelper?
> i dont know how to handle this :(
> 
> my first idea was to write a <f:nestedForm> wich extends the templateVarialbes of <f:form> and restores them after finishing the
> child renderings. good or bad idea? i am totaly unsure.
> 
> thanks
> carsten 
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general



More information about the FLOW3-general mailing list