<?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: div out of scope in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799974#M5102</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; But the line right above that has a function that is not hitched.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 May 2016 19:26:13 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2016-05-02T19:26:13Z</dc:date>
    <item>
      <title>div out of scope</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799967#M5095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following code for a customized widget:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;widget html: &amp;lt;div data-dojo-attach-point="moreParcelInfo"&amp;gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Widget.js, I have this code to Query some more information about this parcel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;queryLocationInfo: function (parcelID) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .........&lt;/P&gt;&lt;P&gt;qryTask_SearchID.execute(qry_SearchID, this.showLocationQueryResults, this.qry_SearchIDError);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;showLocationQueryResults: function (results) {&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.moreParcelInfo.innerHTML = resultItems;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this function, this.moreParcelInfo is undefined. Does it mean this.moreParcelInfo is out of scope of the widget? How to fix it? Thanks&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 13:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799967#M5095</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2016-04-21T13:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: div out of scope</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799968#M5096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You use lang.hitch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14612451164971795 jive_macro_code jive_text_macro" data-renderedposition="112_8_1155_16" jivemacro_uid="_14612451164971795"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;qryTask_SearchID.execute(qry_SearchID, this.showLocationQueryResults, lang.hitch(this, this.qry_SearchIDError));&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 13:25:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799968#M5096</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-04-21T13:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: div out of scope</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799969#M5097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much, Robert. It works. By the way, I really like your customized widgets. They are very useful.&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 15:14:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799969#M5097</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2016-04-21T15:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: div out of scope</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799970#M5098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Don't forget to mark this question as answered by clicking the "Correct Answer" link on the thread that answered your question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 15:22:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799970#M5098</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-04-21T15:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: div out of scope</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799971#M5099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert, I don't know if I need to start a new thread or I can continue to this thread. It is another issue with out of scope.&lt;/P&gt;&lt;P&gt;The error message from Chrome debugging tool: this.showLocationQueryResults is not a function(…)&amp;nbsp; and this.LocationInfo is undefined too&lt;/P&gt;&lt;P&gt;Can you help? Thanks&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;In Widget.html: &amp;lt;div data-dojo-attach-point="LocationInfo" &amp;gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;in Widget.js:&lt;/P&gt;&lt;P&gt; queryLocationInfo: function (parcelID) {&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xhr("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Ftst-gis4.city.arl%2Fwabdatasupport%2FSearchAuxiliary.aspx" rel="nofollow" target="_blank"&gt;http://tst-gis4.city.arl/wabdatasupport/SearchAuxiliary.aspx&lt;/A&gt;&lt;SPAN&gt;", {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; handleAs: "text",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query: { parcelid: parcelID },&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; method: "POST"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }).then(function (data) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lang.hitch(this, this.showLocationQueryResults(data)); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ------I am able to see the "data"-------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ------but the error from Chrome debugging tool: this.showLocationQueryResults is not a function(…) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --------and this.LocationInfo is undefined too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, function (err) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Handle the error condition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var err;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, function (evt) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Handle a progress event from the request if the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // browser supports XHR2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; showLocationQueryResults: function (results) {&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 18:31:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799971#M5099</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2016-05-02T18:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: div out of scope</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799972#M5100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Anytime you have a function then that functions code block is a different scope then the code block that it is called in so you need to use lang.hitch in front of the function keyword.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 18:47:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799972#M5100</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-05-02T18:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: div out of scope</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799973#M5101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Robert, for quick reply.&lt;/P&gt;&lt;P&gt;Yes, I use "lang.hitch(this, this.showLocationQueryResults(data));". But is still not working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 19:16:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799973#M5101</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2016-05-02T19:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: div out of scope</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799974#M5102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; But the line right above that has a function that is not hitched.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 19:26:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799974#M5102</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-05-02T19:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: div out of scope</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799975#M5103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;I have worked it with the correct syntax:&lt;/P&gt;&lt;P&gt;lang.hitch(this, function(data){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lang.hitch(this, this.showLocationQueryResults(data));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }),Thanks you so much for help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 19:32:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/div-out-of-scope/m-p/799975#M5103</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2016-05-02T19:32:02Z</dc:date>
    </item>
  </channel>
</rss>

