Issue Feature Rejected

#70634Proper view helper for generating nested / child records

Pascal Dürsteler 10/12/15, 18:58 updated 10/17/15, 16:09

Description

If I’m wrong, I’ll let you enlighten me happily.

*Current situation*
You want to provide a form where a user creates not just one model / record, but also n nested records, or child records (e.g.: when creating a Pizza object, you also create five Topping records associated with it).

In your form, you scramble something together with f:form.textfield for each Topping and either use the “property” or “name” attribute. However, this gives your form much more complexity, as you have to maintain the index for the params array (pizza[toppings][n][name]) yourself.

You also have to manually throw together some code into your initializeAction for extbase to not raise an error because your data is missing inside __trustedProperties.

*Request for change*
I’d say the following code snipped is a self-explanatory example about how it could work:

<f:form action="create" object="{pizza}" objectName="pizza">
    // fields for pizza itself go here

    <f:form.fields property="pizza.toppings" collection="{pizza.toppings}">
        // fields for each pizza.toppings record go here.
        // context for sub-properties is recognized.

        // field for each topping's "name" property
        <f:form.textfield property="name" />
    </f:form.fields>
</f:form>

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.