[TYPO3-mvc] Nested objects in edit form not updated

Nicolas Owassapian owa at gmx.net
Sat Jan 21 11:05:02 CET 2017


Try it this way:

<label>Spiel 1</label>
<f:form.textfield
name="ligagruppe[ligagruppespieltag][{spieltage.uid}][spieltageinzelergebnis
se][{res.uid}][spiel1]" value="{res.spiel1}" />
<f:form.hidden
name="ligagruppe[ligagruppespieltag][{spieltage.uid}][spieltageinzelergebnis
se][{res.uid}][__identity]" value="{res.uid}"/>

Cheers
Nico

-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org
[mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von
Stefan Thuis
Gesendet: Samstag, 21. Januar 2017 09:43
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: [TYPO3-mvc] Nested objects in edit form not updated

I have created an extension in Typo3 7.6 with extension builder with nested
objects. I want to edit different model objects in one edit form. All
objects are properly connected by relations.

The relevant structure looks like this:

ligagruppe->1:n
(ligagruppespieltag)->spieltag->1:n(spieltageinzelergebnisse)->einzelergebni
sse

The relevant part of my fluid template looks like this:

<f:form action="update" name="ligagruppe" object="{ligagruppe}" >
<f:for each="{ligagruppe.ligagruppespieltag}" as="spieltage">
    <label>Spielort</label>
    <f:form.textfield
name="ligagruppe[ligagruppespieltag][{spieltage.uid}][spielort]"
value="{spieltage.spielort}" />
    <f:form.hidden
name="ligagruppe[ligagruppespieltag][{spieltage.uid}][__identity]"
value="{spieltage.uid}" /><br />
    <f:for each="{spieltage.spieltageinzelergebnisse}" as="res">
        <label>Spiel 1</label>
        <f:form.textfield
name="spieltage[spieltageinzelergebnisse][{res.uid}][spiel1]"
value="{res.spiel1}" />
        <f:form.hidden
name="spieltage[spieltageinzelergebnisse][{res.uid}][__identity]"
value="{res.uid}" /><br />
    </f:for>
</f:for>    
<f:form.submit value="Save" />
</f:form>

When I call the edit form existing values are properly displayed. I can
update everything on the first level (ligagruppe) and second level
(spieltag) but the update on the third level (einzelergebnisse) doesn't
work.

I have tried various combinations for

<f:form.textfield
name="spieltage[spieltageinzelergebnisse][{res.uid}][spiel1]" 

and

<f:form.hidden
name="spieltage[spieltageinzelergebnisse][{res.uid}][__identity]"
value="{res.uid}" /><br />

but values are not updated. What is the correct name attribute to make the
update action work?

_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list