How to attach listener to WAB geoprocessing widget drop down

301
1
Jump to solution
10-28-2019 09:00 AM
MichaelMitchell5
New Contributor III

I'm modifying geoprocessing Widget.js to create cascading drop down menus.  I'm attempting to attach a listener to one of the menus.  I'm doing this towards the bottom of the _createInputNode method.

if(param.name == "Habitat_type"){
        console.log("attach listener");
        on(inputEditor, "change", lang.hitch(this, this.selectChange));
 }

"attach listener" shows in the console but when I change the drop down selection the selectChange method doesn't run.

Thanks for the help!

0 Kudos
1 Solution

Accepted Solutions
MichaelMitchell5
New Contributor III

I changed inputEditor to inputEditor.gEditor and it worked.  I found this by looking at editorManager.js and found the spot where editorName === 'Select' then saw o.gEditor.  After debugging the trouble line in the code I saw that the inputEditor object had a gEditor parameter.  Forgive the terminology if it's wrong.

View solution in original post

0 Kudos
1 Reply
MichaelMitchell5
New Contributor III

I changed inputEditor to inputEditor.gEditor and it worked.  I found this by looking at editorManager.js and found the spot where editorName === 'Select' then saw o.gEditor.  After debugging the trouble line in the code I saw that the inputEditor object had a gEditor parameter.  Forgive the terminology if it's wrong.

0 Kudos