<?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 Re: Widget Close Event in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1052441#M1827</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/123963"&gt;@DavidMartinez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will documentation for appActions and getAppStore be created on the Api Reference page?&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/experience-builder/api-reference/" target="_blank"&gt;https://developers.arcgis.com/experience-builder/api-reference/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I'm trying to troubleshoot a scenario where the Editor widget will be populated with data, but not open. I'm using the code you posted here.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const action = appActions.openWidget(this.state.editorWidget.id);
console.log(action)

//{type: "OPEN_WIDGET", widgetId: "17919c5e87a-widget-1"}
//type: "OPEN_WIDGET"
//widgetId: "17919c5e87a-widget-1"
//__proto__: Object

getAppStore().dispatch(action); &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;It appears the widget is getting the message to enter an edit workflow because the fields are correctly populated. This image shows the widget after I open it via click.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PhilLarkin1_0-1619635827268.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12083i795DDAFA076C2115/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PhilLarkin1_0-1619635827268.png" alt="PhilLarkin1_0-1619635827268.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1104"&gt;@RobertScheitlin__GISP&lt;/a&gt;&amp;nbsp;Were you able to use appActions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Apr 2021 18:53:40 GMT</pubDate>
    <dc:creator>PhilLarkin1</dc:creator>
    <dc:date>2021-04-28T18:53:40Z</dc:date>
    <item>
      <title>Widget Close Event</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1040177#M1658</link>
      <description>&lt;P&gt;How do you listen for and execute code in your widget on panel close?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 14:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1040177#M1658</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-03-24T14:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Close Event</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1040201#M1659</link>
      <description>&lt;P&gt;OK, this is what I got working but I am not sure if this is the recommended workflow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  componentDidUpdate() {
    const {view} = this.state.jimuMapView
    let widgetState: WidgetState = getAppStore().getState().widgetsRuntimeInfo[this.props.id].state;
    if(widgetState === WidgetState.Closed){
      view.map.remove(this.resultLayer);
      view.map.remove(this.bufferFeatureLayer);
      view.popup.close;
    }else if(widgetState === WidgetState.Opened){
      view.map.add(this.resultLayer);
      view.map.add(this.bufferFeatureLayer);
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 14:50:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1040201#M1659</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-03-24T14:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Close Event</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1041074#M1667</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/123963"&gt;@DavidMartinez&lt;/a&gt;&amp;nbsp;Is there not a close or onClose function for widgets?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 15:19:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1041074#M1667</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-03-26T15:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Close Event</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1041102#M1669</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1104"&gt;@RobertScheitlin__GISP&lt;/a&gt;&amp;nbsp; Since Experience Builder is based on React you would get a widget's state from 'this.props.state' to listen to the state change and check this property in componentDidUpdate method. To control opening and closing widgets inside a controller we have app actions. For example,&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/**&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;* Dispatch a action to open a widget&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;* &lt;/SPAN&gt;&lt;SPAN&gt;@param&lt;/SPAN&gt; &lt;SPAN&gt;widgetId&lt;/SPAN&gt;&lt;SPAN&gt; The id of a exb widget&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;export&lt;/SPAN&gt; &lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;dispatchOpenWidget&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;widgetId&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;string&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;action&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; appActions.&lt;/SPAN&gt;&lt;SPAN&gt;openWidget&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;widgetId&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;getAppStore&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN&gt;dispatch&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;action&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 16:44:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1041102#M1669</guid>
      <dc:creator>DavidMartinez</dc:creator>
      <dc:date>2021-03-26T16:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Close Event</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1052441#M1827</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/123963"&gt;@DavidMartinez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will documentation for appActions and getAppStore be created on the Api Reference page?&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/experience-builder/api-reference/" target="_blank"&gt;https://developers.arcgis.com/experience-builder/api-reference/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I'm trying to troubleshoot a scenario where the Editor widget will be populated with data, but not open. I'm using the code you posted here.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const action = appActions.openWidget(this.state.editorWidget.id);
console.log(action)

//{type: "OPEN_WIDGET", widgetId: "17919c5e87a-widget-1"}
//type: "OPEN_WIDGET"
//widgetId: "17919c5e87a-widget-1"
//__proto__: Object

getAppStore().dispatch(action); &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;It appears the widget is getting the message to enter an edit workflow because the fields are correctly populated. This image shows the widget after I open it via click.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PhilLarkin1_0-1619635827268.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12083i795DDAFA076C2115/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PhilLarkin1_0-1619635827268.png" alt="PhilLarkin1_0-1619635827268.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1104"&gt;@RobertScheitlin__GISP&lt;/a&gt;&amp;nbsp;Were you able to use appActions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 18:53:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1052441#M1827</guid>
      <dc:creator>PhilLarkin1</dc:creator>
      <dc:date>2021-04-28T18:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Close Event</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1052448#M1828</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/242657"&gt;@PhilLarkin1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sure this is what I got working for closing the widget (i.e. the widget closing itself from the code)&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.props.dispatch(appActions.closeWidget(this.props.id));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and for messaging other widgets of some data:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.props.dispatch(appActions.widgetStatePropChange(this.props.id, 'pSearchData', cTextElements));&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 28 Apr 2021 19:33:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1052448#M1828</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-04-28T19:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Widget Close Event</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1052544#M1830</link>
      <description>&lt;P&gt;Thanks for your help. Using the id generated from props was the key.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 23:32:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1052544#M1830</guid>
      <dc:creator>PhilLarkin1</dc:creator>
      <dc:date>2021-04-28T23:32:48Z</dc:date>
    </item>
  </channel>
</rss>

