[FLOW3-general] Subproperties not recognized

Steffen Wickham steffen at gaming-inc.de
Mon Jul 30 00:49:15 CEST 2012


Hey there,

I've found the solution by myself.
I just made some errors using the form.input Fluid-ViewHelper arguments.
I declared the address fields as "name" and not as "property" like the
other fields of the Referee model.

So don't be tired and code! ;)

Greetings
Steffen


Am 23.07.2012 16:15, schrieb Steffen Wickham:
> Oh I'm sorry, I messed up with ML restrictions.
>
> Please have a look at the urls for screenshots as follows:
> http://afsvn.de/PropertyMapping.png
> http://afsvn.de/ArgumentsDeliveredByForm.png
>
> I'm really sorry!
>
> Greetings
> Steffen
>
>
> Am 23.07.12 16:10, schrieb Steffen Wickham:
>> Hi there,
>>
>> while development I found a strange behaviour when I try to create a
>> model with references to other models via forms and hope somebody can
>> explain me what's wrong... :-/
>>
>> I have a domain model called "Referee" with references to
>> \TYPO3\Party\Domain\Model\Person called "person" (mapped OneToOne,
>> validate NotEmpty) and \AFSVN\Base\Domain\Model\Address called "address"
>> (mapped ManyToOne unidirectional, no validation) beside some string and
>> \DateTime values. My "Address" model consists of string values without
>> validation at the moment. The model is annotated with @FLOW3\Entity.
>>
>> I've created a normal form with fluid viewhelpers for my new/create
>> action and named the fields like "person.name.firstName" and
>> "address.zip" (according the fluid syntax and model structure). In my
>> initializeCreateAction function of the corresponding ActionController
>> I've set target type for both variables and allowed to create them. Here
>> is my code ("newReferee" is the name of the form):
>>
>> $this->arguments['newReferee']->getPropertyMappingConfiguration()->setTargetTypeForSubProperty('person',
>> '\TYPO3\Party\Domain\Model\Person');
>> $this->arguments['newReferee']->getPropertyMappingConfiguration()->setTargetTypeForSubProperty('address',
>> '\AFSVN\Base\Domain\Model\Address');
>>
>> $this->arguments['newReferee']->getPropertyMappingConfiguration()->allowCreationForSubProperty('person');
>> $this->arguments['newReferee']->getPropertyMappingConfiguration()->allowCreationForSubProperty('address');
>>
>>
>>
>> When I try to create a new Referee it would create the new person entity
>> and save them with the referee object to the database. Just the address
>> model wouldn't be created and saved anyway.
>> I've intercepted the request after the code lines shown before and
>> wondered about the arguments send by the form: The address data seems to
>> be not recognized as property of Referee by FLOW3. Please have a look at
>> the screenshot "ArgumentsDeliveredByForm.png" attached. All address data
>> would be send by the form like "address_street" and "address_zip".
>>
>> So I took a deeper look at the Property Mapping (please have a look at
>> PropertyMapping.png attached). FLOW3 recognize my configuration for
>> subproperties but doesn't map it to my Referee model.
>>
>> I would be very happy when someone can give me a hint, why my Address
>> model couldn't be mapped and how I can fix it?!
>>
>> Many thanks
>> Steffen
>>
>>
>> _______________________________________________
>> FLOW3-general mailing list
>> FLOW3-general at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
> _______________________________________________
> 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