[TYPO3-mvc] Bug in FormHandling with checkboxes

Steffen Ritter info at rs-websystems.de
Sat Dec 5 11:25:27 CET 2009


Hey Folks,
I just encountered why checkboxes on Properties edit forms don't work.
You have an checkbox holding an boolean value. It shows  the current 
state of the flag correctly with following definition

<f:form.checkbox property="inactive" value="1" />

You even can enable a disabled flag using the definition above...

Sadly, unchecking does not work...
Why: if a checkbox is not set, it will not be included in the post 
header. To unset the value extbase would expect the formfield to be set 
but empty or null.

If no data about the field is present, it is not changed.

Here we have to overcome with an solution,

there are 2 options:

a, adding a hidden field to checkboxes and set it via JS
b, implement behavoiur as of multiselect boxes, if there value is not 
present in request it gets unset.

I don't really know where the "i have a form request and map it to the 
object" resides inside extbase. If you can tell me I would have look 
into variant b,

regards

Steffen


More information about the TYPO3-project-typo3v4mvc mailing list