<?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: Web AppBuilder Developer Edition - on(someNode, &amp;quot;click&amp;quot;, someFunction) Executes N Times When Widget Reopened for N Times in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-developer-edition-on-somenode-quot/m-p/1059955#M73215</link>
    <description>&lt;P&gt;The &lt;A href="https://developers.arcgis.com/web-appbuilder/guide/widget-life-cycle.htm" target="_self"&gt;Widget life cycle page&lt;/A&gt; in the documentation might help explain this. The postCreate method happens only once when the widget is first created. The onOpen method happens every time the widget is opened. Since your on event was added during onOpen, every time the widget is opened, another event listener is added.&lt;/P&gt;&lt;P&gt;The other way to make sure the event is only added once would be to remove your on event in the onClose method.&lt;/P&gt;</description>
    <pubDate>Thu, 20 May 2021 14:41:48 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2021-05-20T14:41:48Z</dc:date>
    <item>
      <title>Web AppBuilder Developer Edition - on(someNode, "click", someFunction) Executes N Times When Widget Reopened for N Times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-developer-edition-on-somenode-quot/m-p/1059138#M73165</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an on(someNode, "click", someFunction) in the onOpen() of Widget.js. The problem is that if the widget is closed then reopened (2nd open), the click event on someNode fires twice. If close and reopen the widget again (3rd open), the click event fires three times, so on and so forth...&lt;/P&gt;&lt;P&gt;Is there a way to let the click event on someNode only fire once after reopening the widget?&lt;/P&gt;&lt;P&gt;I appreciate any help. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 14:17:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-developer-edition-on-somenode-quot/m-p/1059138#M73165</guid>
      <dc:creator>XuanKuai</dc:creator>
      <dc:date>2021-05-19T14:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Web AppBuilder Developer Edition - on(someNode, "click", someFunction) Executes N Times When Widget Reopened for N Times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-developer-edition-on-somenode-quot/m-p/1059873#M73208</link>
      <description>&lt;P&gt;Put that into the postCreate function instead of the onOpen function.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 12:29:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-developer-edition-on-somenode-quot/m-p/1059873#M73208</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-05-20T12:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Web AppBuilder Developer Edition - on(someNode, "click", someFunction) Executes N Times When Widget Reopened for N Times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-developer-edition-on-somenode-quot/m-p/1059950#M73214</link>
      <description>&lt;P&gt;Yes! This solves the issue. May I know why the onOpen() duplicates the event handler but the postCreate() does not?&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 14:31:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-developer-edition-on-somenode-quot/m-p/1059950#M73214</guid>
      <dc:creator>XuanKuai</dc:creator>
      <dc:date>2021-05-20T14:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Web AppBuilder Developer Edition - on(someNode, "click", someFunction) Executes N Times When Widget Reopened for N Times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-developer-edition-on-somenode-quot/m-p/1059955#M73215</link>
      <description>&lt;P&gt;The &lt;A href="https://developers.arcgis.com/web-appbuilder/guide/widget-life-cycle.htm" target="_self"&gt;Widget life cycle page&lt;/A&gt; in the documentation might help explain this. The postCreate method happens only once when the widget is first created. The onOpen method happens every time the widget is opened. Since your on event was added during onOpen, every time the widget is opened, another event listener is added.&lt;/P&gt;&lt;P&gt;The other way to make sure the event is only added once would be to remove your on event in the onClose method.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 14:41:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/web-appbuilder-developer-edition-on-somenode-quot/m-p/1059955#M73215</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-05-20T14:41:48Z</dc:date>
    </item>
  </channel>
</rss>

