I created a simple widget using my own code and want to run in WAB developer Edition.
In Widget.html file, I have a dijit/form/Select as the following:
<select class="ControlA"
data-dojo-attach-point="myfirstControl"
data-dojo-type="dijit/form/Select">
</select>
In Widget.js file, I have add some values to the 'Select'; I want to get the current displayed value using the code as the following:
alert("The current selected value is "+ this. myfirstControl.displayedValue);
But the system always indicated that it is not defined. So what if I need to get some information from my dijit/form/Select? What should I do? Thanks a lot!
Linda,
In your Widget.js file did you include _WidgetsInTemplateMixin?
define([
'dojo/_base/declare',
'dijit/_WidgetsInTemplateMixin',
...
function (
declare, _WidgetsInTemplateMixin,
...
return declare([BaseWidget, _WidgetsInTemplateMixin], {
Yes, I did. Thanks
Linda,
Then your function that needs to access this.myfirstControl is out of scope then and you need to use lang.hitch. Can you share the whole function that is accessing this.myfirstControl?