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

Stefan Frömken firma at sfroemken.de
Tue Sep 25 15:37:23 CEST 2012


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