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"
}]
}
}
Solved! Go to Solution.
cob,
You should not rely on SampleServer6 (as it name states it is a sample server and not guaranteed). Do you not have a public url to your ArcGIS Server?.. Yes adding the dom element you want to update to the widgets html is the right way to go. Also you will notice if you look at any other widget that dom elements are accessed using the data-dojo-attach-point="blahblah" and then in your js code you just use this.blahblah.
Yeah this has been an issue for a while Robert – our arc server is running on a VM on our network, and the admin was supposed to secure a DNS for it but it still didn’t work. All of our data is in AGOL anyway – we just use arc server for print templates and internal record-keeping. Moreover, the GP tools we publish to the server won’t work on data in AGOL or in SDE on the server, which would be the other big way in which server could help us…but it won’t. One that we’ve tried many times is the ‘add geometry attributes’ tool which has worked once out of maybe 50 tries, but only on data copied to the server with the GP service (i.e. it is static and doesn’t reflect future edits on the data). All I’m trying to do here is find a way for users in AGOL to select a feature set of polys or lines and have the measurements calc in a popup box (I don’t dare dream of having this updated in the attributes…) There are existing tools but every one of them requires the feature to be digitized, and of course there’s not even a trace tool for folks to follow meandering stream boundary lines, for example. Our users will usually start with imported features, then edit them in the process of map preparation, when they will need to know the new dimensions of the edited features. I can’t believe this is so seemingly difficult.
ANYWAY… I got the feature action to work, displaying at the top of the select widget panel (which is fine), not using the attach-point but setting the id in the span and keeping the dom.ByID lines. I was going to try to increase the font size – I can do that in the span, correct? – but I realized that it doesn’t work for line features at all, and in fact it only measures the first poly feature when multiple features from the same layer are selected. So really not all that useful for my purposes, and I really don’t understand it well enough at this point to make all the necessary tweaks. So what we will probably do is try to use arcgis pro with the feature services we have in AGOL, so they can have the necessary tools for their workflows. I will keep working on WAB since we have so much invested, especially looking for any new custom widgets that could be deployed or modified to help our cause (hint, hint). And someday I will become knowledgeable on this subject matter (before I retire? Who knows…) We really appreciate all your help; you are an invaluable resource… hope ESRI pays you well. ☺
cob
Cob,
This is the line that causes it to only calc the first polygon (line 2, features[0]):
onExecute: function(featureSet){
var geometry = featureSet.features[0].geometry;
And the fact that it will not work on lines is because the you are using the GeometryService
Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.
OK – I’m assuming the first part can’t be as simple as removing the feature index, like featureSet.features.geometry; ? Do I have to make a loop or something? When I remove it from that line and the dom.ByID lines the console logs this error. Thanks, cob
Cob,
Yes you will have to create a for loop to get each selected geometry from the featureSet.features array.
What about this code I found from Ken Doman – do you know him? It’s supposed to extend the measurement widget to add an item to the actionlist in the selection popup, which passes it to the widget for measurement. This would be acceptable if it would work… I placed this js file in the measurement folder in the stemapp and added the widget to my app builder project – to no effect…what else would I need to do? Thanks, cob
Cob,
That is a custom dijit extension for the JS API and not a WAB widget.
Never mind Robert I got it – curly bracket problems…thanks, cob