launch one widget from another

553
5
Jump to solution
07-25-2017 08:04 PM
AlistairFox
Occasional Contributor

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?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Alistair,

   Sure this has been answered a few times:

https://community.esri.com/thread/169518 

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Alistair,

   Sure this has been answered a few times:

https://community.esri.com/thread/169518 

AlistairFox
Occasional Contributor

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?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

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.

AlistairFox
Occasional Contributor

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);

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

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?

0 Kudos