Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#9655 closed defect (fixed)

DropDownSelect: cannot be created programmatically without a source node

Reported by: Bryan Forbes Owned by: Nathan Toone
Priority: high Milestone: 1.4
Component: Dijit - Form Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:

Description

Every other widget in Dijit can be created by doing this:

var widget = new dijit.some.Widget({ /* properties here */ });

When you do that with dijit.form.DropDownSelect?, it throws an error:

node is undefined

It stems from the postCreate function doing this:

if(dojo.attr(this.srcNodeRef, "disabled")){
	this.attr("disabled", true);
}

To me, this seems unnecessary since the attributes of the node should be taken care of by _Widget if they are declared on the prototype (and "disabled" is declared on the prototype of dijit.form._FormWidget). I'm attaching a modified test which adds three DropDownSelects? to the test: two programmatic (of which, one is disabled), and one disabled from markup.

Attachments (1)

test_DropDownSelect.html (15.4 KB) - added by Bryan Forbes 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Bryan Forbes

Attachment: test_DropDownSelect.html added

comment:1 Changed 10 years ago by bill

Owner: set to Nathan Toone
Summary: dijit.form.DropDownSelect cannot be created programmatically without a source nodeDropDownSelect: cannot be created programmatically without a source node

Assigning to Nathan although of course if you have a fix Bryan feel free to check in.

comment:2 Changed 10 years ago by Nathan Toone

Resolution: fixed
Status: newclosed

(In [19804]) Fixes #9655 - do not rely on srcNodeRef existing...it may not

comment:3 Changed 10 years ago by Nathan Toone

(In [19808]) Refs #9655 - sometimes this.dropDown is missing as well - we need to account for that

comment:4 Changed 9 years ago by bill

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