[MAGNOLIA-224] Checkboxes can't be unselected in dialogs Created: 30/Nov/04  Updated: 17/Mar/09  Resolved: 30/May/05

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 2.0 Final
Fix Version/s: 2.1 Final

Type: Bug Priority: Major
Reporter: Keith Battocchi Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Win XP, IE 6


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

In a dialog, an unselected checkbox can be selected (and the updated state will be saved), but if changed from selected to unselected, the updated state will remain "true". This appears to apply to all dialogs. The samples/pageProperties dialog's hideInNav checkbox, the samples/form/edit dialog's mandatory checkbox, and the samples/form/submit dialog's lineAbove checkbox all demonstrate this problem.



 Comments   
Comment by Vinzenz Wyser [ 30/Nov/04 ]

hm, strange ...

workaround untill fixed: use mozilla to deselect (sorry for that

Comment by Boris Kraft [ 01/Dec/04 ]

Workaround:
change the control to a select list with true/false options. Make sure to keep the type as "Boolean" and set the option values to "true" and "false". (radios should work also).

Comment by Bert Schulzki [ 22/Feb/05 ]

This bug possibly occurs due to having two input controls with the same name. For each boolean attribute "xyz" with a checkbox control the rendered html looks like this:

<input type="checkbox" name="xyz" ...>
<input type="hidden" name="xyz" ...>

It is very likely, that IE is processing these controls in another order than FF - and if order matters, than it could be the reason for this bug.

Comment by Philipp Bracher [ 30/May/05 ]

the checkbox defined the same name as the hiddenfield

WE SHOULD CLEAN UP THE BUTTONSET!!! I get crazy

Comment by Andreas Weder [ 31/May/05 ]

Here is the backport of the patch for the 2.02 branch:

Index: C:/Projects/Magnolia_2_02_Branch/src/main/info/magnolia/cms/gui/dialog/DialogButtonSet.java
===================================================================
— C:/Projects/Magnolia_2_02_Branch/src/main/info/magnolia/cms/gui/dialog/DialogButtonSet.java (revision 566)
+++ C:/Projects/Magnolia_2_02_Branch/src/main/info/magnolia/cms/gui/dialog/DialogButtonSet.java (working copy)
@@ -73,7 +73,7 @@
public void setOption(ContentNode configNode) {
//checkboxSwitch -> only one option, value always true/false
ArrayList options=new ArrayList();

  • Button button=new Button(this.getName(),"");
    + Button button=new Button(this.getName()+ "_dummy","");
    button.setLabel(configNode.getNodeData("buttonLabel").getString());
    if (configNode.getNodeData("selected").getBoolean()==true) button.setState(Button.BUTTONSTATE_PUSHED);
    button.setValue("true");

Works great (thx Philipp).

Generated at Mon Feb 12 03:15:19 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.