AnsweredAssumed Answered

custom widget - the task and how to use: this.own, and digit/_WidgetsInTemplateMixin

Question asked by levmichael on Jul 16, 2020
Latest reply on Jul 22, 2020 by harishp_Chetu

I am relatively new to ArcGIS Web AppBuilder (Developer Edition) 2.16

in last 2 months I've written several custom widgets,

yet there are 3 areas I feel I have not enough knowledge:


1. When do I need to do this.own and what are the parameters

        I learned that this.own is used to prevent memory leak,

        but I don't know when it is needed and when it is not needed, and the meaning of its parameters.


2. When do I need to use dijit/_WidgetsInTemplateMixin and what is the usage function of postMixInProperties: function() {...}


        I learned that postMixInProperties is called very early,

        but I don't know exactly why it is needed at all,

        and if there are cases where dijit/_WidgetsInTemplateMixin is needed

        but postMixInProperties function is not needed.


3. I'd like to get a little comprehensive explanation about what issues should be handled in each of the functions:

postCreate, startup, and onOpen, 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..


Help will be greatly appreciated.