<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Asynchronous call in postCreate in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/asynchronous-call-in-postcreate/m-p/798553#M4938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a widget that needs to get information from a geoprocessing service on creation in order to populate a table.&amp;nbsp; 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).&lt;/P&gt;&lt;P&gt;What I'm doing: (not sure how to make it look like formatted code, but here I go.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;postCreate: function (){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.inherited(arguments);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;myGPfunction();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;followupFunction();&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;startup: function(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.inherited(arguments);&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;onOpen: function(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//do something&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can get the followupFunction() to wait for myGPfunction() (I've figured out how to incorporate the .then).&lt;/P&gt;&lt;P&gt;My problem is when I click to launch to widget in my map, postCreate,startup,onOpen all fire off.&amp;nbsp; I see in the console that PanelManager &amp;amp; WidgetManager say my widget have been created, then I see my results from the myGPfunction after that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I get things to wait until I receive my data before continuing with creation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Dec 2018 16:46:03 GMT</pubDate>
    <dc:creator>JaysonLindahl</dc:creator>
    <dc:date>2018-12-10T16:46:03Z</dc:date>
    <item>
      <title>Asynchronous call in postCreate</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/asynchronous-call-in-postcreate/m-p/798553#M4938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a widget that needs to get information from a geoprocessing service on creation in order to populate a table.&amp;nbsp; 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).&lt;/P&gt;&lt;P&gt;What I'm doing: (not sure how to make it look like formatted code, but here I go.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;postCreate: function (){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.inherited(arguments);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;myGPfunction();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;followupFunction();&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;startup: function(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.inherited(arguments);&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;onOpen: function(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//do something&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can get the followupFunction() to wait for myGPfunction() (I've figured out how to incorporate the .then).&lt;/P&gt;&lt;P&gt;My problem is when I click to launch to widget in my map, postCreate,startup,onOpen all fire off.&amp;nbsp; I see in the console that PanelManager &amp;amp; WidgetManager say my widget have been created, then I see my results from the myGPfunction after that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I get things to wait until I receive my data before continuing with creation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2018 16:46:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/asynchronous-call-in-postcreate/m-p/798553#M4938</guid>
      <dc:creator>JaysonLindahl</dc:creator>
      <dc:date>2018-12-10T16:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Asynchronous call in postCreate</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/asynchronous-call-in-postcreate/m-p/798554#M4939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jayson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You do not have control of the widget life cycle events and delaying their execution. You need to re-examine your work flow and adjust.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2018 17:55:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/asynchronous-call-in-postcreate/m-p/798554#M4939</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-12-10T17:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Asynchronous call in postCreate</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/asynchronous-call-in-postcreate/m-p/798555#M4940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was afraid of that.&amp;nbsp; I assume the startup and onOpen functions operate in the same manner?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2018 19:36:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/asynchronous-call-in-postcreate/m-p/798555#M4940</guid>
      <dc:creator>JaysonLindahl</dc:creator>
      <dc:date>2018-12-10T19:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Asynchronous call in postCreate</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/asynchronous-call-in-postcreate/m-p/798556#M4941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2018 20:17:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/asynchronous-call-in-postcreate/m-p/798556#M4941</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-12-10T20:17:00Z</dc:date>
    </item>
  </channel>
</rss>

