[Dojo-interest] dijit.form.RadioButton label variable not working?
Devine, James
james.devine at fmr.com
Mon Jul 20 12:18:40 EDT 2009
Don't use the same id for both (actually, I am not sure if you
need/should use the 1st id in this scenario).
Try this->
myRadioButton = new dijit.form.RadioButton({
id: "radioButtonArea",
name: "radioButtonArea",
group: "radiobuttonGroup",
label: "Radio button label",
value: "whoCaresRadio",
checked: false,
type: "radio"}, "radioButtonArea_SOMEOTHERID");
<input id="radioButtonArea_SOMEOTHERID" />
_____
From: dojo-interest-bounces at mail.dojotoolkit.org
[mailto:dojo-interest-bounces at mail.dojotoolkit.org] On Behalf Of James
Markham
Sent: Monday, July 20, 2009 12:04 PM
To: dojo maillist
Subject: [Dojo-interest] dijit.form.RadioButton label variable
not working?
I've been playing around with programmatically creating the
Dijit RadioButton and CheckBox widgets, and was trying to use their
"label" attribute.
In the example html that follows, using the "label" attribute
when you create the RadioButton or CheckBox widget will throw an error:
"this.containerNode is null"
Is that expected behavior?
<html>
<head>
<title>dijit.form.RadioButton's label attribute</title>
<script
type="text/javascript"
src="http://o.aolcdn.com/dojo/1.3/dojo/dojo.xd.js"
<http://o.aolcdn.com/dojo/1.3/dojo/dojo.xd.js> >
</script>
<script type="text/javascript">
dojo.require("dijit.form.RadioButton");
dojo.require("dijit.form.CheckBox");
dojo.addOnLoad(function() {
var myRadioButton;
var myCheckBox;
myRadioButton = new dijit.form.RadioButton({
id: "radioButtonArea",
name: "radioButtonArea",
group: "radiobuttonGroup",
label: "Radio button label",
value: "whoCaresRadio",
checked: false,
type: "radio"}, "radioButtonArea");
myCheckBox = new dijit.form.CheckBox({
id: "checkBoxArea",
name: "checkBoxArea",
label: "Check box label",
value: "whoCaresCheck",
checked: false}, "checkBoxArea");
});
</script>
</head>
<body class="tundra">
<form id="myform">
<input id="radioButtonArea" /><br/>
<input id="checkBoxArea" />
</form>
</body>
</html>
Jim Markham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20090720/92c22acb/attachment.htm
More information about the Dojo-interest
mailing list