Closed Bug 7100 Opened 26 years ago Closed 26 years ago

JS change state (enabled/checked) of html:checkbox doesn't redraw

Categories

(Core :: XUL, defect, P3)

PowerPC
Mac System 8.5
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: Brade, Assigned: pierre)

References

()

Details

Below is a test case for enabling and disabling a checkbox from a radio button pair. This bug has to do with the checkbox not being updated to reflect it's new state (both enabling/disabling and checking are broken). <?xml version="1.0"?> <?xml-stylesheet href="resource:/res/samples/xul.css" type="text/css"?> <?xml-stylesheet href="file:///Journey/ImageDim2.css" type="text/css"?> <window xmlns:html="http://www.w3.org/TR/REC-html40" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="300" height="300" onload="onLoad()"> <html:script> function dimSetOriginalSize() { // disable checkbox var constrainCheckbox = document.getElementById("dimConstrain.checkbox"); if ( constrainCheckbox ) { constrainCheckbox.setAttribute( "disabled", "true" ); } } function dimSetCustomSize() { // enable checkbox var constrainCheckbox = document.getElementById("dimConstrain.checkbox"); if ( constrainCheckbox ) { constrainCheckbox.removeAttribute( "disabled" ); constrainCheckbox.setAttribute( "value", "1" ); } } function onLoad() { dimSetOriginalSize(); } function dimConstrainClick() { } </html:script> <box align="vertical"> <html:input type="radio" id="dimOrigSize.radio" name="sizeradio" value="1" onclick="dimSetOriginalSize()" /> <html:label for="dimOrigSize.radio">Original Size</html:label> <html:br/> <html:input type="radio" id="dimCustomSize.radio" name="sizeradio" onclick="dimSetCustomSize()" /> <html:label for="dimCustomSize.radio">Custom Size</html:label> </box> <html:br/> <html:input type="checkbox" id="dimConstrain.checkbox" onclick= "dimConstrainClick()" /> <html:label for="dimConstrain.checkbox">Constrain</html:label> </window>
Assignee: trudelle → evaughan
reassigning to evaughan for triage. Is this a XUL problem, or a forms checkbox problem? Should we fix it in either case?
Assignee: evaughan → kmcclusk
I think this is you widget isn't it?
clarification: the example above is "text.xul" and the 3rd line referencing a local stylesheet can be removed
Assignee: kmcclusk → pollmann
Eric, form DOM related so I am re-assigning to you
Assignee: pollmann → pierre
Pierre, this works on Windows and Linux. Can you hook up Mac widgets? The routine to fix is: mozilla/widget/src/mac/nsWindow::Enable() On GTK, for example, this looks like: (GTK calls it Widget instead of Window) //------------------------------------------------------------------------- // // Enable/disable this component // //------------------------------------------------------------------------- NS_METHOD nsWidget::Enable(PRBool bState) { if (mWidget) { ::gtk_widget_set_sensitive(mWidget, bState); } return NS_OK; } But on Mac, instead of making a native widget call, this currently just sets a member variable: //------------------------------------------------------------------------- // // Enable/disable this component // //------------------------------------------------------------------------- NS_IMETHODIMP nsWindow::Enable(PRBool bState) { mEnabled = bState; return NS_OK; }
Added at test case URL: http://blueviper.mcom.com/forms/test.html Select "Checkbox" in the left pane, then find the checkbox for the disabled property in the right pane.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Target Milestone: M7
Fixed.
Status: RESOLVED → VERIFIED
Re-tested setting/unsetting the checked and disabled properties for Checkbox and Radiobutton on 1999-08-19-11 build. Status changed to Verified.
BULK MOVE: Changing component from XUL to XP Toolkit/Widgets: XUL. XUL component will be deleted.
Component: XUL → XP Toolkit/Widgets: XUL
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: gerardok → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.