While I don't have a solution (yet) I can confirm there is a problem.
I didn't have much time so I changed it to radio buttons, but here is
what I've seen so far: If the value of the element is the checked
value (I had the default 0 and 1) the output is correct and the
checkbox can be unchecked. But it can't be changed back, because both
the hidden element and the checkbox are 0 if that's the set value.
IIRC the decorator doesn't get the set checked and unchecked values
and is therefor falling back to the defaults - and it might also be
the same for the normal checkbox.
nico
Apsy wrote:
I would like to know if for you my code is correct, because is so,
there's a bug in the Dojo Checkbox Component :p
$cgu_accept = new Zend_Dojo_Form_Element_CheckBox('cgu_accept');
$cgu_accept->setDijitParam('invalidMessage', 'You must validate the
cgu');
$cgu_accept->setCheckedValue('checked');
$cgu_accept->setUncheckedValue('unchecked');
$cgu_accept->setLabel('blablabla')
->addValidator(new Zend_Validate_Identical($cgu_accept-
>getCheckedValue()))
->setIgnore(true);
produces HTML code :
<dd>
<input type="hidden" value="0" name="cgu_accept"/>
<div wairole="presentation" class="dijitReset dijitInline
dijitCheckBox" role="presentation" widgetid="cgu_accept">
<input
type="checkbox"
dojoattachevent
="onmouseover:_onMouse,onmouseout:_onMouse,onclick:_onClick"
dojoattachpoint="focusNode"
class="dijitReset dijitCheckBoxInput"
name="cgu_accept"
id="cgu_accept"
value="0"
tabindex="0"
style="-moz-user-select: none;"/>
</div>
</dd>
As you can see here, i've defined the "checked' and 'unchecked"
value but i have a 0 in the input value for the both...
Any Help ?