Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#7809 closed defect (invalid)

slider can't dojo.connect onchange through its domNode

Reported by: aaronreed Owned by:
Priority: high Milestone: 1.3
Component: Dijit - Form Version: 1.0
Keywords: Cc:
Blocked By: Blocking:


If I have a dijit.form.HorizontalSlider? or dijit.form.VerticalSlider? and try to use dojo.connect(dojo.byId('mySlider'), 'onchange', alertFunction), my alertFunction never gets called. However, if I use dojo.connect(dijit.byId('mySlider'), 'onChange', alertFunction), then alertFunction does get called with the string value of the slider.

I believe that both are supposed to work and that the conenct with dojo.byId will pass in the event object to the handler and the connect with dijit.byId will pass in the string value to the handler. I read this in the dojo book ( and I observed this using dijit.form.ValidationTextBox?. That is why I think this is a bug with slider.

Attachments (1)

testonchange.html (2.7 KB) - added by aaronreed 13 years ago.
testcase using dojo.connect and widgets

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by aaronreed

Attachment: testonchange.html added

testcase using dojo.connect and widgets

comment:1 Changed 13 years ago by dante

this is likely 'invalid' - dijit.byId / onChange is a synthetic event (actually, just a function) and it is not supported to mix and match DOM events with Widget "events". onChange is meant to normalize the "onchange" dom event, and only passes the changed value. Some widgets may _seem_ to support mixing of dom events and dijit events, but only as an artifact of the nature of event bubbling. dijit.byId('foo').domNode !== dojo.byId('foo'), though in some cases it does (but it doesn't count, because it isn't technically supported)

comment:2 Changed 13 years ago by Douglas Hays

Milestone: tbd1.3
Resolution: invalid
Status: newclosed

comment:3 Changed 11 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.