Select to view content in your preferred language

WAB feature actions code ???

8876
42
Jump to solution
01-02-2018 11:41 AM
CharlesBailey
Occasional Contributor

Where does the feature actions code go in the select widget manifest? What's wrong with this? Can someone please show me a correct sample? Thanks, cob

{
"name": "Select2",
"platform": "HTML",
"version": "2.6",
"wabVersion": "2.6",
"author": "Esri R&D Center Beijing",
"description": "",
"copyright": "",
"license": "http://www.apache.org/licenses/LICENSE-2.0",
"properties": {
"supportMultiInstance": false,

"featureActions": [{
"name": "ShowVertex",
"uri": "ShowVertexFeatureAction"
}]
}

}

0 Kudos
42 Replies
CharlesBailey
Occasional Contributor

Robert I hate to keep bothering you, but just one more little question on this - how would I refresh (blank out) the html labels on widget open? (or close, whatever would be best to blank out the last measurement when the widget is closed and re-opened)? I get an error every time I touch the functions in the Widget.js, unexpected identifier. Thanks, cob

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Cob in the widgets onOpen and onClose methods you can add code to set the dom elements innerHTML to “”

0 Kudos
CharlesBailey
Occasional Contributor

That’s what I thought, but anything I do to the methods (besides re-commenting them out) causes this error. And would this be the way to do it if the methods would work or do I need to reference it some other way? Thanks, cob

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

I would have to see the code you are attempting to know what you are doing wrong, because that should work.

0 Kudos
CharlesBailey
Occasional Contributor

Here it is – my masterpiece 😄 Thanks, cob

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Cob,

   You do not have “dom” defined in your Widget.js requires. So that is your main issue.

CharlesBailey
Occasional Contributor

OK, but before that the method causes an error even when there is no dom reference. If you change the OnOpen method back to just the console log you will see what I mean. Thanks, cob

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Put a comma after the base class line.

CharlesBailey
Occasional Contributor

Duh – you mean require it like this? (of course it won’t work but am I on right track?) I know the require has to be outside the define because it is returning basewidget value (?)

0 Kudos
CharlesBailey
Occasional Contributor

Another duh moment – put the dom in the function. But for some reason it won’t accept the ‘length’ and ‘lengthmi’ doms in the OnOpen method, although it will in the On Close. Gives a dom not defined error…any idea why? Anyway it works well enough for now – thanks Robert!

0 Kudos