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

Franz Koch typo3.RemoveForMessage at elements-net.de
Tue Aug 10 12:59:44 CEST 2010


Hey again,

> @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)

Having a look at the radio viewHelper there raised some questions:

Assuming property "foo" is registered as type "object" in the model, but 
not given yet (NULL), if I understood your scenario correctly:



f.form.checkbox:
------------------------------------------------------------------
property: hidden (boolean)
Why should it not be possible to set a value (true/false) for a boolean 
property? What if the checkbox should work inverted? Or doesn't this 
make sense for a boolean value - not sure?

One should have to define if the checkbox is checked by default or not 
when the value is NULL/not set. We can't assume the state "TRUE", can 
we? Just imagine a form where you have to accept the terms of condition?

----

property: foo (object)
if the object is NULL and no UID is given as value, it doesn't make 
sense to have a checkbox for it, does it? Using checkbox for properties 
of type object can only be used to couple/decouple a specific object to 
the property. So assuming a UID 1 if no value is given is wrong in my 
eyes. A value has to be specified explicitly for it. The value can only 
be of type integer then, a string value should lead to a exception.

Someting like <f:form.checkbox name="post[foo][]" value="bar" />
doesn't make sense, does it? Or what would be the expected result? You 
can't map "bar" to anything here, can you? Thus, no string values for 
objects relations.



f.form.radio:
-----------------------------------------------------------------
Can we somehow force that at least two radio boxes for the same 
property/name have to be rendered? Radio boxes at least need two 
instances for the same property/name to work (or is this already 
implemented? didn't check it).

----

property: foo (object)
We can't map a string value as object, can we? Same as with checkboxes 
(see above).





I'll have a look at the select vH later on - have to do some work now ;)

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list