[TYPO3-mvc] Improve handling of bound properties in checkbox, radio and select ViewHelpers

Bastian Waidelich bastian at typo3.org
Mon Aug 9 20:16:15 CEST 2010


Hey list,

as you might have noticed, form.checkbox, form.radio and form.select 
ViewHelpers do not work as expected yet in some cases..
E.g. checkbox/radio ViewHelpers just die with an exception when you bind 
them to properties of a NULL object (which is the case for all objects 
in a "newAction" by default) [1]

After discussing this with Michael Feinbier I've tried to collect all 
important cases for the three ViewHelpers. The result are three pretty 
big "input-output-matrices".
As this is all created very theoretical, I'm not sure whether the result 
matches the expected behavior.

@all please have a look at the attached images at 
http://forge.typo3.org/issues/9214 (or download the Excel file that 
contains the matrices on 3 sheets)

Notes:
- For the example case I've chosen a modified version of the well-known 
blog example. "given_v3.png" explains the properties of the post object 
that is bound to the form.

- lots of the example make no sense at all. They just demonstrate how 
the ViewHelpers should react for the given object types

- The property "foo" at the bottom of each matrix refers to any property 
of the post, when the post object itself is NULL (that's the case in the 
"new"-template for example)

If you agree with the behavior, I'll use the matrices as basis for unit 
tests in order to refactor the ViewHelpers.

Best,
Bastian


[1] http://forge.typo3.org/issues/8854


More information about the TYPO3-project-typo3v4mvc mailing list