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

Michael Feinbier mf at hdnet.de
Thu Aug 12 09:56:20 CEST 2010


Hey Bastian
Am 09.08.10 20:16, schrieb Bastian Waidelich:
> Hey list,
>
> @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)

Sorry, I did not make it to reply to this faster.
I had a look at your matrix:

f:form.checkbox:
---------------
I agree, that if you bind to a boolean the value must not be specified. 
The only thing you could do would be inverting the value so that if you 
check the box, the value is FALSE and vice versa.

But in my opinion this would be a bad practice. You should name your 
property correctly, so that if it is checked, the value has to be TRUE.

But there is another thing which I like to see in the checkbox. I think 
it should be possible to bind a property of every type to a checkbox, 
not only booleans or Arrays/Iterables

Imagine the 'author' property. Let's say our Blog must not have an 
author. So it can be NULL. Imagine furthermore there is only one author 
DO in my repository. Then I think it would be useful to render a 
checkbox like this:
<f:form.checkbox property="author" value="{theOnlyAuthorDO}" />

Now, if I check the checkbox the {theOnlyAuthorDO} will be bound to the 
author property, if I do not check it, the value of author would be NULL 
(which is allowed)

I am pretty shure, that people will need this. What do you think?


Micha



More information about the TYPO3-project-typo3v4mvc mailing list