Reputation: 1075
I'm setting the value of a dijit/form/NumberTextBox programatically and when I debug I see that the displayedValue has been set, not the value. Any idea why it would behave this way? My NumberTextBox is located on a template widget, maybe that has something to do with it?
Template:
<input type="text"
style="width: 50px; height:20px;"
data-dojo-type="dijit/form/NumberTextBox"
required="true"
data-dojo-attach-point="tbDiam"
data-dojo-props="constraints:{min:6,max:100,places:0},
invalidMessage:'Please enter numeric value, no decimals.',
rangeMessage:'Invalid diameter.' ""/>
Setting the value:
this.tbDiam.set("value", "25");
getting the value:
this.tbDiam.value; //undefined
this.tbDiam.displayedValue();//"25"
Thanks
Upvotes: 0
Views: 1121
Reputation: 1138
The value of a dojo form widget can be retrieved by using get("value")
. The reason why the .value
does not work is that tbDiam is just a wrapper for the actual input and doesn't actually hold the value of the input. So tbDiam.get("value")
should return what you want.
Upvotes: 3