Opened 14 years ago

Closed 14 years ago

Last modified 11 years ago

#4870 closed defect (worksforme)

dijit.form.FilteringSelect, setValue & onChange

Reported by: guest Owned by: Douglas Hays
Priority: high Milestone: 1.1
Component: Dijit - Form Version: 1.0
Keywords: FilteringSelect setValue onChange Cc: [email protected]
Blocked By: Blocking:


Hello, I use the setValue function to select a default value in the FilteringSelect? dijit, but this function seems to not call the onChange function. Is this the correct behaviour ? Thx in advance. Kilroy

Attachments (2)

test_FilteringSelect.html (1.1 KB) - added by Douglas Hays 14 years ago.
states.json (3.8 KB) - added by Douglas Hays 14 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 14 years ago by Adam Peller

Owner: set to Douglas Hays

comment:2 Changed 14 years ago by Douglas Hays

Resolution: worksforme
Status: newclosed

This seems to work for me. Can you append a testcase? The nightly build has an example of a setDisplayedValue() that triggers onChange. The first select box has a button to set the value to Kentucky and you can see the input box to the right change to KY via onChange.
You can modify this test to call
instead of
to verify that this works as well.

comment:3 Changed 14 years ago by guest

Resolution: worksforme
Status: closedreopened

The difference with the example is that I create my dijit programaticaly.

var w = dojo.byId('actionsAvalon');
if (w)
	var dfltValue = w.value;
	w = new dijit.form.FilteringSelect
		    name          :
		  , type          : w.type
		  , disabled      : w.disabled
		  , autocomplete  : true
		  , required      : true
		  , store         : new{ url: '/avalon/getActions' })
		  , onChange      : function(action) {_this.onChangeAction(action); }
		  , searchAttr    : 'label'
		  , invalidMessage: _this._strings['invalid_action']
		  , promptMessage : _this._strings['missing_action']
		, w
	/* [BUG] Ticket #4870: setValue don't call onChange */

Even If i set the value in the constructor.


comment:4 Changed 14 years ago by bill

Maybe there's a race condition if you call setValue() before the store has loaded the data? Try attaching the setValue() call to a button, or running after a delay, to see if that works.

Also, you can (and should) attach testcases using the "attach file" button.

BTW, you can replace {{ {function(action) {_this.onChangeAction(action); } }}} with dojo.hitch(_this, "_onChangeAction") . It's just a little shorter to type.

comment:5 Changed 14 years ago by bill

Milestone: 1.01.1

comment:6 Changed 14 years ago by guest

I've changed :

/* [BUG] Ticket #4870: setValue n'appelle pas onChange */

with :

  , 15000

but setValue don't call onChange.


Changed 14 years ago by Douglas Hays

Attachment: test_FilteringSelect.html added


Changed 14 years ago by Douglas Hays

Attachment: states.json added


comment:7 Changed 14 years ago by Douglas Hays

Resolution: worksforme
Status: reopenedclosed

I attached a programmatic example that works perfectly. Please try to recreate, starting with this example and tweak until it fails. Also, make sure you are using the latest trunk. I tested with [11354] with FF2 and IE6 on WinXP.

comment:8 Changed 11 years ago by bill

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