Closed
Bug 80399
Opened 23 years ago
Closed 23 years ago
Radiogroup not able to get the value attribute of the default radio item
Categories
(Core :: XUL, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla0.9.6
People
(Reporter: racham, Assigned: bugzilla)
Details
Attachments
(3 files)
763 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
772 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
1.00 KB,
patch
|
bugs
:
superreview+
|
Details | Diff | Splinter Review |
Radiogroup widget is not able to get the value of the default radio item in the group when queried for Radiogroup.value Here is the situation in xul : <radiogroup id="foo"> <radio group="foo" value="bar1" label="test1" checked="true"/> <radio group="foo" value="bar2" label="test2"/> </radiogroup> in js (say in onInt()) : when I do var serverTypeRadioGroup = document.getElementById("foo"); dump("default value = " + serverTypeRadioGroup.value + "\n"); I would expect it to print 'bar1' as that is the value of the default radio item (as checked attribute is set to true there). instead, I have to do some thing like this for that to happen serverTypeRadioGroup.value = serverTypeRadioGroup.selectedItem.getAttribute("value"); dump("default value = " + serverTypeRadioGroup.value + "\n");
Withtout the hack I mentioned in the previous update, radiogroup waits for user to make explicit selection of one of radio items to give a valid value for radiogroup.value query.
Why don't you use something like this: var serverTypeRadioGroup = document.getElementById("foo").selectedItem; dump("default value = " + serverTypeRadioGroup.value + "\n"); 'value' is a method so you don't need element.getAttribute('value') just use element.value for it.
Comment 4•23 years ago
|
||
Seems busted. Ben, you can whip up a fix for this in no time.
Assignee: hyatt → ben
I have a patch for this, but should this be done in radio.xml or radioBindings.xml ?
if i apply the patch to /xpfe/global/resources/content/bindings/radio.xml then this problem is fixed. Will make a diff -u after cvs update. brb.
Comment 9•23 years ago
|
||
Ben should sr... I don't remember why you would need this...
Comment 10•23 years ago
|
||
Comment on attachment 34295 [details] [diff] [review] apply this patch and the above testcase will show bar2 sr=ben@netscape.com
Attachment #34295 -
Flags: superreview+
Updated•23 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
Comment 11•23 years ago
|
||
patch, -> .9.9
Priority: -- → P3
Target Milestone: mozilla1.0 → mozilla0.9.9
Assignee | ||
Comment 12•23 years ago
|
||
-->me
Assignee: ben → blakeross
Status: ASSIGNED → NEW
Target Milestone: mozilla0.9.9 → mozilla0.9.6
Assignee | ||
Comment 13•23 years ago
|
||
Fixed.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•