[TYPO3-mvc] CheckboxViewHelper does not work

Stephan Petzl spetzl at gmx.at
Thu Apr 22 12:30:44 CEST 2010


Bastian Waidelich schrieb:
> Stephan Petzl wrote:
> 
> Hi Stephan,
> 
>> is there a reason why the value attribute is not marked as "must have"?
> 
> Because it's optional for input tags according to (X)HTML spec. If you'd 
> omit it in a classic checkbox tag
> <input type="checkbox" name="showAddress" />
> you'd have the same problem..

ok, i see. then i think the value attribute should be validated as 
"required", so IMO a error message should be shown in case it is not set.

other possibillity would be that the viewhelper sets the value property 
for me. i mean the viewhelper knows that i want to bind my model 
property (of type int) to the checkbox value, so i dont see a reason why 
the viewhelper doesnt set the value attritbute according to my models 
property.

or am i wrong?

> 
> 
>> only checkboxes which are checked will be included in the post, so it's
>> not possible to unset a domain model's property.
> 
> That's probably rather an issue of Extbase than of the checkbox 
> viewhelper because, again, it's just the default checkbox behavior: when 
> you don't tick it, the field won't appear in the GET/POST vars (only in 
> some browsers IIRC).
> 
without knowing much about viewhelpers, i would say, that it's the 
responsibillity of the formViewHelper to render hidden fields where they 
are needed. if you agree, i could dig into this and maybe supply a patch...


-- 
Best Regards
Stephan Petzl


More information about the TYPO3-project-typo3v4mvc mailing list