<?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: custom widget - the task and how to use: this.own, and digit/_WidgetsInTemplateMixin in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-the-task-and-how-to-use-this-own-and/m-p/785094#M3509</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At a high level, &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;this.own : &lt;/STRONG&gt;The own function is defined in dijit/Destroyable, which is a base of dijit/_WidgetBase and thus most widgets.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Use : &lt;/STRONG&gt;dijit/Destroyable is used to track handles of an instance, and then destroy them when the instance is destroyed.&lt;/P&gt;&lt;P&gt;The application must call destroy() on the instance in order to release the handles.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Links : &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://dojotoolkit.org/reference-guide/1.8/dijit/Destroyable.html"&gt;http://dojotoolkit.org/reference-guide/1.8/dijit/Destroyable.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://dojotoolkit.org/reference-guide/1.8/dojo/Evented.html"&gt;http://dojotoolkit.org/reference-guide/1.8/dojo/Evented.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;When do I need to use&amp;nbsp;dijit/_WidgetsInTemplateMixin:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When using this template in a directly extended widget class, you will need to mixin dijit._WidgetsInTemplateMixin in addition to dijit._TemplatedMixin. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; that dijit.Declaration-based widget classes automatically include dijit._WidgetsInTemplateMixin.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Links : &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://dojotoolkit.org/api/?qs=1.10/dijit/_WidgetsInTemplateMixin"&gt;https://dojotoolkit.org/api/?qs=1.10/dijit/_WidgetsInTemplateMixin&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://dojotoolkit.org/reference-guide/1.10/dijit/_WidgetsInTemplateMixin.html"&gt;https://dojotoolkit.org/reference-guide/1.10/dijit/_WidgetsInTemplateMixin.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;PostCreate() , startUp() and onOpen : &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PostCreate and startUp function are used to initialize the widget only for the first time when widget comes into role in application. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;onOpen() function is used to open widget whenever required and onOpen() function is executed with _openHander of widget to set several &amp;nbsp;related properties and state of widget.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jul 2020 11:29:25 GMT</pubDate>
    <dc:creator>HarishPalaniappan</dc:creator>
    <dc:date>2020-07-22T11:29:25Z</dc:date>
    <item>
      <title>custom widget - the task and how to use: this.own, and digit/_WidgetsInTemplateMixin</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-the-task-and-how-to-use-this-own-and/m-p/785093#M3508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am relatively new to ArcGIS Web AppBuilder (Developer Edition) 2.16&lt;/P&gt;&lt;P&gt;in last 2 months I've written several custom widgets,&lt;/P&gt;&lt;P&gt;yet there are&amp;nbsp;3 areas I feel I have not enough knowledge:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. When do I need to do&amp;nbsp;&lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;&lt;EM&gt;this.own&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;and what are the parameters&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I learned that this.own is used to prevent memory leak,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; but I don't know when it is needed and when it is not needed, and the meaning of its&amp;nbsp;parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. When do I need to use&amp;nbsp;&lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;&lt;EM&gt;dijit/_WidgetsInTemplateMixin&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; and what is the usage function of&amp;nbsp;&lt;SPAN style="color: #800000;"&gt;&lt;EM&gt;&lt;STRONG&gt;postMixInProperties&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;: function() {...}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I learned that&amp;nbsp;&lt;SPAN style="color: #800000;"&gt;&lt;EM&gt;&lt;STRONG&gt;postMixInProperties&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; is called very early,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; but I don't know exactly why it is needed at all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and if there are cases where&amp;nbsp;&lt;SPAN style="; color: #800000;"&gt;&lt;STRONG&gt;&lt;EM&gt;dijit/_WidgetsInTemplateMixin&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d;"&gt;&lt;SPAN&gt;&amp;nbsp;is needed&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d;"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; but&amp;nbsp;&lt;SPAN style="color: #800000;"&gt;&lt;EM&gt;&lt;STRONG&gt;postMixInProperties&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN&gt;&amp;nbsp;function is not needed.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. I'd like to get a little comprehensive explanation about what issues should be handled in each of the functions:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="color: #800000; "&gt;postCreate&lt;/EM&gt;&lt;/STRONG&gt;, &lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;&lt;EM&gt;startup&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;, and &lt;SPAN style="color: #800000;"&gt;&lt;EM&gt;&lt;STRONG&gt;onOpen&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;, since when I write new custom widgets, sometimes I am not sure what type of tasks to put in each, e.g. where to put this.sceneView.when(){...} and similar things that refer viewModels, graphics etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN&gt;Help will be greatly appreciated.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN&gt;Michael&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2020 20:33:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-the-task-and-how-to-use-this-own-and/m-p/785093#M3508</guid>
      <dc:creator>MichaelLev</dc:creator>
      <dc:date>2020-07-16T20:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: custom widget - the task and how to use: this.own, and digit/_WidgetsInTemplateMixin</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-the-task-and-how-to-use-this-own-and/m-p/785094#M3509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At a high level, &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;this.own : &lt;/STRONG&gt;The own function is defined in dijit/Destroyable, which is a base of dijit/_WidgetBase and thus most widgets.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Use : &lt;/STRONG&gt;dijit/Destroyable is used to track handles of an instance, and then destroy them when the instance is destroyed.&lt;/P&gt;&lt;P&gt;The application must call destroy() on the instance in order to release the handles.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Links : &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://dojotoolkit.org/reference-guide/1.8/dijit/Destroyable.html"&gt;http://dojotoolkit.org/reference-guide/1.8/dijit/Destroyable.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://dojotoolkit.org/reference-guide/1.8/dojo/Evented.html"&gt;http://dojotoolkit.org/reference-guide/1.8/dojo/Evented.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;When do I need to use&amp;nbsp;dijit/_WidgetsInTemplateMixin:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When using this template in a directly extended widget class, you will need to mixin dijit._WidgetsInTemplateMixin in addition to dijit._TemplatedMixin. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; that dijit.Declaration-based widget classes automatically include dijit._WidgetsInTemplateMixin.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Links : &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://dojotoolkit.org/api/?qs=1.10/dijit/_WidgetsInTemplateMixin"&gt;https://dojotoolkit.org/api/?qs=1.10/dijit/_WidgetsInTemplateMixin&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://dojotoolkit.org/reference-guide/1.10/dijit/_WidgetsInTemplateMixin.html"&gt;https://dojotoolkit.org/reference-guide/1.10/dijit/_WidgetsInTemplateMixin.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;PostCreate() , startUp() and onOpen : &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PostCreate and startUp function are used to initialize the widget only for the first time when widget comes into role in application. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;onOpen() function is used to open widget whenever required and onOpen() function is executed with _openHander of widget to set several &amp;nbsp;related properties and state of widget.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2020 11:29:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-the-task-and-how-to-use-this-own-and/m-p/785094#M3509</guid>
      <dc:creator>HarishPalaniappan</dc:creator>
      <dc:date>2020-07-22T11:29:25Z</dc:date>
    </item>
  </channel>
</rss>

