[TYPO3-mvc] rewritten property manager and multiple objects in one form

PJL Cramer email at domain.com
Thu Oct 18 20:55:38 CEST 2012


Dank Henjo,

seems even 'contacts' is not in the arguments.
Are these the arguments received from the form or from within the Extbase code?
Or perhaps the right question is: How are these form field-names 
related to the code used?

Hmm, better rest my head for a night and then try again… If there is 
anyone out there who can shine a light on this: feel free to do so! :-)

Regards,
Pascal

On 2012-10-18 14:27:25 +0000, Henjo Hoeksma said:

> Hi Pascal,
> 
> it seems you are missing a level here:
> 
>> $this->arguments['newContact']->
> 
> The argument is 'contacts'.
> 
> I haven't worked this propertyMapping thing out so I am not sure if you 
> need what you do here.
> 
> In line of what Arjen wrote, you would get something like this:
> 
> protected function initializeCreateAction() {
> foreach ($this->arguments['contatcs'] as $contact) {
>  
> $contact->getPropertyMappingConfiguration()->allowCreationForSubProperty('newContact'); 
> 
> }
> 
> 
> Henjo
> 
> 
> 
> On Oct 18, 2012, at 3:57 PM, Pascal Cramer <pascal at roguesheep.nl> wrote:
> 
>> Hi gents,
>> 
>> I am just staring out on my adventures with Extbase and Fluid and I 
>> think I am missing out on some info.
>> It seems to me you are probably discussing the solution I am looking 
>> for but I cannot put all the pieces together.
>> 
>> I have an parent-child 1:n relation (card - contacts) and I would like 
>> to create a new child object in the parent's edit-form.
>> The editing of child objects in the same form works out-of-the-box with 
>> the Extension builder code using the notation:
>> <f:form.textfield name="card[contacts][{contact.uid}][firstName]" />
>> <f:form.hidden name="card[contacts][{contact.uid}][__identity]" 
>> value="{contact.uid}"/>
>> 
>> But what notation should I use for the new child object?
>> If I use
>> <f:form.textfield property="crisisCard[contacts][newContact][firstName]" />
>> and try to check for it using
>> 
>> public function initializeUpdateAction() {
>> if ($this->arguments['newContact']) {
>> $contactConfiguration = 
>> $this->arguments['newContact']->getPropertyMappingConfiguration();
>> [….snip…]
>> Extbase throws me a:
>> #1216909923: The argument "newContact" does not exist.
>> 
>> What am I missing here? (feeling very noobish :-)
>> 
>> 
>> Thanks,
>> Pascal
>> 
>> On 2012-10-16 12:44:30 +0000, Stefano Cecere said:
>> 
>>> Hi Arjien
>>> i'm really curious: where did you find docs about the New Property 
>>> Mapper? apart 
>>> http://flow.typo3.org/documentation/guide/partiii/propertymapping.html 
>>> i didn't find anything!
>>> ps: how is it that you and Henjo Hoeksma have such similar surnames!?!? 
>>> incredible! :)
>>> ciao
>>> stefano
>>> On 16/10/12 14:24, Arjen Hoekema wrote:
>>>> Hi Henjo,
>>>> Did you tell the propertymapper that creation/modification of the
>>>> subproperties is allowed:
>>>> protected function initializeCreateAction() {
>>>> $this->arguments['person']->getPropertyMappingConfiguration()->allowCreationForSubProperty('address'); 
>>>> $this->arguments['person']->getPropertyMappingConfiguration()->allowCreationForSubProperty('address.first'); 
>>>> }
>>>> Same goes for "allowModificationForSubProperty" when doing updates with
>>>> nested objects.
>>>> Kind regards,
>>>> Arjen Hoekema
>> 
>> 
>> _______________________________________________
>> 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