help with selectedItem

Discuss building things with or for the Mozilla Platform.
Post Reply
User avatar
gemal
Posts: 223
Joined: November 7th, 2002, 3:49 am
Location: Copenhagen, Denmark
Contact:

help with selectedItem

Post by gemal »

why doesn't selectedItem work?

I'm getting:
Error: val.getAttribute is not a function
Source File: chrome://global/content/bindings/radio.xml#radiogroup.selectedItem (setter)
Line: 6

XUL test file:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="t();">
<script type="application/x-javascript">
function t() {
var rg = document.getElementById("x");
rg.selectedItem = 1;
}
</script>
<radiogroup id="x">
<radio value="0" label="1"/>
<radio value="1" label="2"/>
</radiogroup>
</window>
Henrik Gemal
Mozilla Evangelist
©dn
Posts: 683
Joined: April 20th, 2003, 1:53 pm
Location: GB
Contact:

Post by ©dn »

perhaps this is one of those cases where selectedIndex is needed instead ?
User avatar
gemal
Posts: 223
Joined: November 7th, 2002, 3:49 am
Location: Copenhagen, Denmark
Contact:

Post by gemal »

©dn wrote:perhaps this is one of those cases where selectedIndex is needed instead ?


kind of. I fixed this thing, now there's a problem with it not working in Firebird

Now check this:
http://gemal.dk/test/test.xul

works in Mozilla not Firebird
Henrik Gemal
Mozilla Evangelist
User avatar
Chris Cook
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada
Contact:

Post by Chris Cook »

What build are you using? I experienced this JS bug quite some time ago and I had hoped it was fixed by now. There should be a bug for this though I haven't looked.
Post Reply