I have a widget that needs to get information from a geoprocessing service on creation in order to populate a table. Even though I've setup the geoprocessing service to be synchronous, it seems like the code is behaving as if it were asynchronous (at least the postCreate/startup/onOpen functions).
What I'm doing: (not sure how to make it look like formatted code, but here I go.)
postCreate: function (){
this.inherited(arguments);
myGPfunction();
followupFunction();
},
startup: function(){
this.inherited(arguments);
},
onOpen: function(){
//do something
},
I can get the followupFunction() to wait for myGPfunction() (I've figured out how to incorporate the .then).