Opened 13 years ago

Closed 13 years ago

#2991 closed defect (wontfix)

Checkbox loosing checked property

Reported by: guest Owned by: davidb
Priority: high Milestone: 0.9
Component: Widgets Version: 0.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

dojo.widget.Checkbox.inputNode.checked is lost if one of the widget's ancestor nodes is moved to another DOM node. Causes problems since even though the graphics show the checkbox as checked, the submited form will not contain the checkbox field.

Example:

<div id='node1'>

<div id='node2'>

<input id='test' dojoType='checkbox'>

</div>

</div>

<div id='node3'></div>

<script type='text/javascript'>

dojo.addOnLoad(function() {

dojo.widget.byId("test").setValue(true);

this outputs TRUE

alert(dojo.widget.byId("test").inputNode.checked);

var node2 = dojo.byId("node2");

var node3 = dojo.byId("node3");

node2.parentNode.removeChild(node2);

node3.appendChild(node2);

this outputs FALSE, even though we haven't touched the checked value

alert(dojo.widget.byId("test").inputNode.checked);

});

Workaround (unsafe): use dojo.widget.byId("test")._setInfo() after changing the DOM structure

Change History (2)

comment:1 Changed 13 years ago by bill

Milestone: 0.9
Owner: changed from bill to davidb

Not sure why this would be an issue, especially with the new code, but giving to David to look at. If for some reason this doesn't work with the new code we may just want to close as wontfix as this is a pretty esoteric issue.

comment:2 Changed 13 years ago by davidb

Resolution: wontfix
Status: newclosed

Thanks for reporting the bug.

Bill, I agree we should close this as wontfix.

If the bug reporter can recreate this bug in dijit trunk, please reopen and provide a complete working test case (html file).

Note: See TracTickets for help on using tickets.