[TYPO3-mvc] Problem with dot-notation and getPropertyPath

Stefan Frömken firma at sfroemken.de
Thu Sep 27 10:31:53 CEST 2012


Hello MVC-List,

as workaround I have removed the connection to the property and solved 
it with the name attribute:

<f:form.checkbox
name="newResult[questions][{question.uid}][answers][{answer.uid}][value]"
value="{answer.title}" />

In my opinion the concept of aggregate root is not fully implemented in 
this case :-(

Stefan


Am 25.09.2012 15:37, schrieb Stefan Frömken:
> Hello MVC-List,
>
> I have a checkbox in my FLUID-Template:
>
> <f:form.checkbox
> property="questions.{question.uid}.answers.{answer.uid}.value"
> value="{answer.title}" />
>
> As you can see my aggregate root is a little bit bigger than others. The
> problem is: getPropertyPath always returns NULL for this property which
> results in following error message on my website:
>
> "Checkbox viewhelpers can only be bound to properties of type boolean or
> array."
>
> OK...it seems that my property path is not correct. So I tried some
> other path:
>
> <f:form.checkbox property="questions.storage.answers.storage.value"
> value="{answer.title}" />
>
> and this one:
>
> <f:form.checkbox property="questions.answers.value"
> value="{answer.title}" />
>
> The problem seems to be the ObjectStorage. It is a valid instance of
> ArrayAccess but you can't access the contained objects with something
> like this:
>
> $subject[$pathSegment]
>
> So in my opinion getPropertyPath can not access ObjectStorages
> correctly. But maybe I'm wrong?!?!
>
> Stefan



More information about the TYPO3-project-typo3v4mvc mailing list