[Dojo-interest] Problem with dijit.form.RadioButton inside an XHTML document

15 views
Skip to first unread message

Charles Vejnar

unread,
May 2, 2011, 2:44:37 PM5/2/11
to dojo-i...@mail.dojotoolkit.org
Hi,

I am new to this mailing-list; I hope I am in the right place. Sorry if
it not the case.

With Dojo 1.6, the following example isn't working: in Firefox 3.6 and
Chrome, the 2 radio buttons can be selected at the same time.

I don't understand where I am doing something wrong.

Thanks for your help

Charles

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script src="dojotoolkit/dojo/dojo.js.uncompressed.js"
djConfig="parseOnLoad:true" ></script>
<script type="text/javascript">
dojo.require("dijit.form.Form");
dojo.require("dijit.form.RadioButton");
</script>
<link rel="stylesheet" type="text/css"
href="dojotoolkit/dijit/themes/claro/claro.css" ></link>
</head>
<body class=" claro ">
<form id="myform" dojoType="dijit.form.Form">
<input type="radio" dojoType="dijit.form.RadioButton"
name="drink" id="radioTwo" value="coffee"></input>
<br />
<input type="radio" dojoType="dijit.form.RadioButton"
name="drink" id="radioThree" value="water"></input>
<br />
</form>
</body>
</html>

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://docs.dojocampus.org
Dojo-i...@mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

paweluz

unread,
May 3, 2011, 6:28:21 AM5/3/11
to dojo-i...@mail.dojotoolkit.org
HI

I checked that and it works for me. My code looks exactly like yours, exept
the path to the library that looks like that:

<script type="text/javascript" djConfig="parseOnLoad: true"
src="lib/js/dojo/dojo.js">

Try with that library, and not with uncompressed. I checked on Chrome
11.0.696.60 and FF 3.6.17.

Cheers,
Pawel


--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Problem-with-dijit-form-RadioButton-inside-an-XHTML-document-tp2890900p2893700.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.

Charles Vejnar

unread,
May 3, 2011, 7:13:54 AM5/3/11
to dojo-i...@mail.dojotoolkit.org
Hi,

Uncompressed or not doesn't change the problem. I can select both
buttons at the same time.

But did you save the file as a .xhtml not .html ? I wasn't maybe enough
clear but it's a problem as XHTML not as HTML.

Charles

paweluz

unread,
May 3, 2011, 5:33:22 PM5/3/11
to dojo-i...@mail.dojotoolkit.org
I have checked that with html and xhtml on both web browser and it still
works for me - I can select just one radio button on page.

Pawel

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Problem-with-dijit-form-RadioButton-inside-an-XHTML-document-tp2890900p2896198.html

Charles Vejnar

unread,
May 4, 2011, 4:16:34 AM5/4/11
to dojo-i...@mail.dojotoolkit.org, paw...@o2.pl
Hi,

I tested it with Firefox 3.6.17 and Chrome under Linux but also Firefox
4 and IE9 under Windows: the problem is there everywhere.

The problem is related to the CSS, i.e without the CSS the problem isn't
there. By looking at the DOM with Firebug, the div around the
radiobutton gets "dijitRadioChecked" and "dijitChecked" classes when I
click on it and are keeping these classses even when I am clicking on
the second radiobutton. But the value for the form is correct and keep
the last clicked button.

To be sure we are using the same file, I am attaching it (I also changed
for CDN).

Thanks for your help,

Charles

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script

src="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js"

djConfig="parseOnLoad:true" ></script>
<script type="text/javascript">
dojo.require("dijit.form.Form");
dojo.require("dijit.form.RadioButton");
</script>
<link rel="stylesheet"

href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css"
/>


</head>
<body class=" claro ">
<form id="myform" dojoType="dijit.form.Form">
<input type="radio" dojoType="dijit.form.RadioButton"
name="drink" id="radioTwo" value="coffee"></input>
<br />
<input type="radio" dojoType="dijit.form.RadioButton"
name="drink" id="radioThree" value="water"></input>
<br />
</form>
</body>
</html>

Le 03/05/2011 23:33, paweluz a �crit :

radio.xhtml

Bill Keese

unread,
May 8, 2011, 7:11:24 AM5/8/11
to dojo-i...@mail.dojotoolkit.org
You are right, it's a bug, specifically that _RadioButtonMixin.js is doing:

dojo.query("INPUT[type=radio]")

which isn't finding anything.    It finds the two controls when "input" is in lowercase:

dojo.query("input[type=radio]")

(Not sure if it would work if you capitalized INPUT in your XHTML but I guess people don't do that.)

Anyway, if you file a bug with your test case attached we'll fix it.

Le 03/05/2011 23:33, paweluz a écrit :

I have checked that with html and xhtml on both web browser and it still
works for me - I can select just one radio button on page.

Pawel


Reply all
Reply to author
Forward
0 new messages