[TYPO3-mvc] How to edit (multiple) child-objects?
Johannes C. Schulz - EnzephaloN IT-Solutions
info at enzephalon.de
Fri Mar 9 13:03:57 CET 2012
Hello list.
Again I have to ask you about my halting problem:
I have an root-object called "accreditation", this has childs called
"person" of type ObjectStorage. Each person can have one or more "passport"
of type ObjectStorage.
How can I assign passports for each person in one form. I tried to use a
hacky-way by Lorenz Ulrich, but this only worked if I did a "setProperty()"
- if I did an "addProperty" on the $personObject (generated by
personRepository->findOneByProperty) an error "member function on
non-object" was thrown.
So I tried the "right" way, using the property-tag inside a f:form.select
like this:
<f:for each="{accreditation.persons}" as="person"><f:form.select
property="persons.passport" options="{passports}"
optionLabelField="passportname" multiple="TRUE" size="6" /> </f:for>
also tried:
<f:for each="{accreditation.persons}" as="person"><f:form.select
property="{persons.passport}" options="{passports}"
optionLabelField="passportname" multiple="TRUE" size="6" /> </f:for>
But here I got other errors: "Given property name is not of type string."
or
2nd: "The form field name "[]" is invalid. Reason: "[]" used not as last
argument."
Now I do not have any more ideas. Also I tried to write
propery="person.passport" or property="{person.passport}".
What should I write inside the "property"-tag inside the select to access
the property of a child-object?
Hope someone can help!
Best regards
Johannes
More information about the TYPO3-project-typo3v4mvc
mailing list