Is it possible at the completion of the user capturing a polygon using the edit widget to launch widget in the web app, so the user doesn't have to know to go and launch it manually?
Solved! Go to Solution.
Alistair,
Sure this has been answered a few times:
awesome thanks, new I had seem that somewhere. As an extension to that how would you fire off a geo-processing service on completion of an edit function using the edit widget?
Alistair,
you would just use the Geoprocessor class for the JS API like in this sample:
Geoprocessing - Service area task | ArcGIS API for JavaScript 3.21
in the _autoApplyEditWhenGeometryIsModified method of the edit widget.
I’ve found the function that runs when the user clicks close on the attribute inspector after creating a new feature in edit widget. I can get an alert to popup from inside that function. But the gp tool code never runs.
I’m wondering if its because its on a widget inside this web app builder framework? And not that same as being just a page using the javascript API??
_enableToAnswerEventForEditorATI: function() {
alert("geoproc");
//call geoprocessing service
gp = new Geoprocessor("https://xxxxx/arcgis/rest/services/EBP_Irwin/Overlay/GPServer/Overlay/submitJob");
gp.setOutputSpatialReference({wkid: 102100});
var params = { "returnZ": false, "returnM": false,"f": "json", };
gp.execute(params);
Alistair,
No that would not be the issue. WAB is just a custom JS API App. I don't see and result or error callback code in what you posted. Do you see the GP task called in your browsers network tab or any errors in the console?