Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#9742 closed defect (invalid)

NumberTextBoxes not being found with dijit.findWidgets() or dijit.getChildren()

Reported by: Pete Smith Owned by:
Priority: low Milestone: tbd
Component: Dijit - Form Version: 1.3.2
Keywords: Cc: Douglas Hays
Blocked By: Blocking:


This is repeatable even off the

go into firebug and do


You will see, no NumberTextBoxes? are found. This stops them from being validated with dijit.form.validate().

Change History (4)

comment:1 Changed 12 years ago by Pete Smith

to show even more strangeness, if I do a forEach and console.log each widget, it logs:

constraints=Object _connects=[4]

(which is somehow broken object?)

comment:2 Changed 12 years ago by bill

Priority: highlow
severity: criticalminor

Oh it's finding them, it's just that NumberTextBox displays strangely in the debugger, probably because NumberTextBox.toString() prints out a confusing value (as you listed above). The object is not broken. Try:


etc. to see that the members are intact. And try


to see what toString() is returning.

If you have a test case where they aren't getting validated please attach it.

comment:3 Changed 12 years ago by bill

Cc: Douglas Hays added
Resolution: invalid
Status: newclosed

More info on this: _Widget.js defines a toString() method and that's what usually appears in firebug output:

toString: function(){
	return '[Widget ' + this.declaredClass + ', ' + ( || 'NO ID') + ']'; // String

I think that NumberTextBox is picking up the toString() from MappedTextBox:

toString: function(){
	var val = this.filter(this.attr('value')); // call filter in case value is nonstring and filter has been customized
	return val != null ? (typeof val == "string" ? val : this.serialize(val, this.constraints)) : ""; // String

and that's returning "". Of course the debugger can't print "" to represent an object, so I guess it is using some internal routine to print the link. It's confusing but I don't think there's anything we can do to change it, since toString() is being used in other parts of the code to refer to the value that the NumberTextBox holds.

comment:4 Changed 11 years ago by bill

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