<?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 how to capture a widget before unload in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-capture-a-widget-before-unload/m-p/812402#M6607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Opening a web map in an iframe.&lt;/P&gt;&lt;P&gt;The web map app has multiple widgets on it.&lt;/P&gt;&lt;P&gt;Need to capture the event just before one of the widget unloads when user closes the window containing the iframe.&amp;nbsp; Need to capture and handle for this from "within" the widget code to access various widget variables and functions.&lt;/P&gt;&lt;P&gt;Is there a built in event for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Sep 2019 19:09:59 GMT</pubDate>
    <dc:creator>WorkPlaece</dc:creator>
    <dc:date>2019-09-09T19:09:59Z</dc:date>
    <item>
      <title>how to capture a widget before unload</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-capture-a-widget-before-unload/m-p/812402#M6607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Opening a web map in an iframe.&lt;/P&gt;&lt;P&gt;The web map app has multiple widgets on it.&lt;/P&gt;&lt;P&gt;Need to capture the event just before one of the widget unloads when user closes the window containing the iframe.&amp;nbsp; Need to capture and handle for this from "within" the widget code to access various widget variables and functions.&lt;/P&gt;&lt;P&gt;Is there a built in event for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2019 19:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-capture-a-widget-before-unload/m-p/812402#M6607</guid>
      <dc:creator>WorkPlaece</dc:creator>
      <dc:date>2019-09-09T19:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to capture a widget before unload</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-capture-a-widget-before-unload/m-p/812403#M6608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is something you would have to do catch at a much higher level then the widget code. When the app that holds the widget is closed you will not get to see code inside the widget react to the app being closed. In the main app that creates the iframe you will have to catch the close event.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;iframe&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;contentWindow&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;onbeforeunload &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Still not sure how you would get access to the widgets properties though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:33:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-capture-a-widget-before-unload/m-p/812403#M6608</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T09:33:37Z</dc:date>
    </item>
  </channel>
</rss>

