Feature #4218

Support for properties of nested objects using "property"-argument

Added by Marcel Rosenberger over 12 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Should have
Category:
-
Target version:
-
Start date:
2009-08-10
Due date:
% Done:

100%

Estimated time:
Has patch:

Description

Hi all,

it would be great to be able to use the "property"-argument to specify values for nested objects. Here is an example:

Given a class “Club” and a class “User”. The Club has a property “user” that references a User-Object.

Club->user = User-Object

With Fluid I want to provide a formular for editing the Club-Object AND User-Object (inside the Club-Object) simultaneously. What I am trying to do is something like:

<f:form
    method="post" 
    controller="Club" 
    action="mailChanges" 
    name="updatedClub" 
    object="{club}" 
    arguments="{club : club}">

<p>Clubname: <f:form.textbox property="name" /></p>
<p>Responsible for Club: <f:form.textbox property="user.name" /></p>

[...submit...]

</form>

When the formular is submitted the club's name and the name for the responsible should be changed.

#1

Updated by Sebastian Kurfuerst over 12 years ago

  • Status changed from New to Accepted
  • Assignee set to Sebastian Kurfuerst
#2

Updated by Sebastian Kurfuerst over 12 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

done.

#3

Updated by Marcel Rosenberger about 12 years ago

  • Status changed from Resolved to New

Using r1642 and my snippet posted above <f:form.textbox property="user.name" /> is resolved correctly. However when submitting the formular an exception is thrown: #1251730702: The value must be of type "Tx_MyExtension_Domain_Model_Club", but was of type "array".

For helping to reconstruct the error the sample post-data sent to my action handler is:

    Änderung beauftragen
tx_myextension_club[__hmac]    [.....a lot of text....]
tx_myextension_club[__referrer][actionName]    edit
tx_myextension_club[__referrer][controllerName]    Club
tx_myextension_club[__referrer][extensionName]    myextension
tx_myextension_club[updatedClub][__identity]    2
tx_myextension_club[updatedClub][city]    Mönchengladbach
tx_myextension_club[updatedClub][county][__identity]    8
tx_myextension_club[updatedClub][county][name]    Düsseldorf
tx_myextension_club[updatedClub][kreis][__identity]    14
tx_myextension_club[updatedClub][kreis][name]    Krefeld
tx_myextension_club[updatedClub][lsbnr]    9000200
tx_myextension_club[updatedClub][name]    JC Mönchengladbach
tx_myextension_club[updatedClub][myextensionnr]    2000021
tx_myextension_club[updatedClub][section][]    Breitensport
tx_myextension_club[updatedClub][url]    
tx_myextension_club[updatedClub][user][__identity]    3
tx_myextension_club[updatedClub][user][address]    Dummy Street
tx_myextension_club[updatedClub][user][city]    Düsseldorf
tx_myextension_club[updatedClub][user][email]    no@mail.de
tx_myextension_club[updatedClub][user][name]    Max Mustermann
tx_myextension_club[updatedClub][user][zip]    12345

#4

Updated by Marcel Rosenberger about 12 years ago

I noticed that the error only appears when I send the "section" property. The snipped from my view looks like this:

<f:form.checkbox property="section" value="Breitensport" /> Breitensport<br />
<f:form.checkbox property="section" value="Wettkampfsport" /> Wettkampfsport<br />
<f:form.checkbox property="section" value="Leistungssport" /> Leistungssport<br />

The property "section" is of type "array". When I remove those 3 lines from my view everything works as expected.

#5

Updated by Sebastian Kurfuerst almost 12 years ago

  • Status changed from New to Resolved

Sorry for so long not responding, I think the problem is due to the checkbox ViewHelper which still causes some trouble.

Also available in: Atom PDF