#7493 closed defect (invalid)
dojo.query doesn't retrieve result for RadioButtons
Reported by: | nunomartinsinet | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dijit - Form | Version: | 1.1.1 |
Keywords: | dojo.query, radio, buttons, forEach | Cc: | |
Blocked By: | Blocking: |
Description (last modified by )
Using the dojo version 1.1.1 (latest revision from repository in tags) in FF3 with Ubuntu I tried the following code in a form with some input texts and radio buttons:
dojo.query('[widgetId]').forEach( function(w) { var widget=w.id; if(dijit.byId(widget)) { dijit.byId(widget).destroy(); } });
Everything go fine for the input texts, but it retrieves me the following error because of the radio buttons:
"Error: Tried to register widget with id==XXX but that id is already registered"
I fixed the problem with the following change in my code:
dojo.query('div[widgetId],input.dijitCheckBoxInput').forEach( function(w) { var widget=w.id; if(dijit.byId(widget)) { dijit.byId(widget).destroy(); } });
Thanks and keep up the good work,
You can contact me by email: [email protected]…
Change History (2)
comment:1 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
Note: See
TracTickets for help on using
tickets.
Looks like dojo.query() is working correctly to me.
There's no reason to assume that the top node of a widget (this.domNode) has an id attribute. It's often true, but certainly not guaranteed.
You should call dijit.byNode() on each node returned from dojo.query()