<?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: How do I use esriRequest in a widget? in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876442#M13603</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert, thank you very much it works now &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see you moved &lt;SPAN style="color: #0000ff; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;"dojo/domReady! &lt;/SPAN&gt;to the end of the define list. Was this what caused my problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I want to access xml documents from at different domain I still need the line &lt;SPAN style="color: #008200; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;esriConfig.defaults.io.proxyUrl = "/PHP_proxy/proxy.php";&lt;/SPAN&gt; If I remove the line I get the error: &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;"&lt;EM&gt;esri.config.defaults.io.proxyUrl is not set.&amp;nbsp; If making a request to a CORS enabled server, please push the domain into esri.config.defaults.io.corsEnabledServers&lt;/EM&gt;"&lt;/SPAN&gt;. You mentioned that WAB takes care of this for me, but not in my case. Should I some where in other Web AppBuilder files configure this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Nov 2015 23:34:31 GMT</pubDate>
    <dc:creator>MathiasKP</dc:creator>
    <dc:date>2015-11-09T23:34:31Z</dc:date>
    <item>
      <title>How do I use esriRequest in a widget?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876440#M13601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, can anyone guide me in a direction on how to use the esriRequest function in a Web Appbuilder Widget?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have just started using Web AppBuilder Developer Edition. I started with extending the sample widget Demo with a button&lt;/P&gt;&lt;P&gt;Widget.html:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;div&amp;gt;
&amp;lt;button id="gotoPosition" data-dojo-type="dijit/form/Button" type="button" data-dojo-attach-point="gotoPosition"&amp;gt;Go to position&amp;lt;/button&amp;gt;
&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;P&gt;I then extended the onOpen: function() in widget.js to zoom to a position&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; ...
 onOpen: function(){
&amp;nbsp; console.log('onOpen');
&amp;nbsp; var map = this.map;
&amp;nbsp; var Long, Lat;
&amp;nbsp; var LocPoint, point;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; //Go to position
&amp;nbsp; on(this.gotoPosition, 'click', lang.hitch(this, function(evt){&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('gotoPosition 2');
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.clear();
&amp;nbsp;&amp;nbsp;&amp;nbsp; Lat = 55;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Long = 15;
&amp;nbsp;&amp;nbsp;&amp;nbsp; LocPoint = new Point([Long,Lat]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.centerAndZoom(LocPoint,17);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }));
&amp;nbsp; },
...&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From &lt;A href="https://developers.arcgis.com/javascript/jssamples/data_requestXML.html" title="https://developers.arcgis.com/javascript/jssamples/data_requestXML.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Access data (XML) | ArcGIS API for JavaScript&lt;/A&gt; I found out how to use esriRequest and from &lt;A href="https://developers.arcgis.com/javascript/jshelp/ags_proxy.html" title="https://developers.arcgis.com/javascript/jshelp/ags_proxy.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Using the proxy | Guide | ArcGIS API for JavaScript&lt;/A&gt; how to install the proxy and finally putting it all together in one HTML file (esriRequest_xml.html) which works fine.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;nbsp; &amp;lt;title&amp;gt;XML Content&amp;lt;/title&amp;gt;
&amp;nbsp; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;
&lt;SPAN&gt;&amp;nbsp; &amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fjs.arcgis.com%2F3.14%2Fesri%2Fcss%2Fesri.css" target="_blank"&gt;http://js.arcgis.com/3.14/esri/css/esri.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;
&amp;nbsp; 
&lt;SPAN&gt;&amp;nbsp; &amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fjs.arcgis.com%2F3.13%2F" target="_blank"&gt;http://js.arcgis.com/3.13/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;
&amp;nbsp; &amp;lt;script&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; require(["dojo/dom", "dojo/on", "dojo/dom-class", "dojo/_base/json", "dojox/xml/parser", "esri/config", "esri/request", "dojo/domReady!"], function(dom, on, domClass, dojoJson, xmlParser, esriConfig, esriRequest) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('ok')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriConfig.defaults.io.proxyUrl = "/PHP_proxy/proxy.php";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var url = "url to a xml docement";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var requestHandle = esriRequest({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "url": url,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "handleAs": "xml"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; requestHandle.then(requestSucceeded, requestFailed);
&lt;SPAN style="font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function requestSucceeded(response, io){&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.write("Succes");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do something with the xml data
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function requestFailed(error, io){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.write("Fail");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp; &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;nbsp; &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then tried to put the javascript code from esriRequest_xml.html into the onOpen: function()&amp;nbsp; but this resulted in the error "&lt;EM&gt;Uncaught TypeError: Cannot read property 'io' of undefined&lt;/EM&gt;" Maybe because of wrong scope?, but don't know how to fix this. Can anyone guide me how to get esriRequest to work? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:59:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876440#M13601</guid>
      <dc:creator>MathiasKP</dc:creator>
      <dc:date>2021-12-12T10:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use esriRequest in a widget?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876441#M13602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mathias,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;define([
&amp;nbsp; /*rearranged your requires two where out of place and domReady should always be last*/
&amp;nbsp; 'dojo/_base/declare',
&amp;nbsp; 'jimu/BaseWidget',
&amp;nbsp; "dojo/on",
&amp;nbsp; 'dojo/_base/lang',
&amp;nbsp; "esri/graphic", 
&amp;nbsp; "esri/geometry/Point",
&amp;nbsp; "dojo/dom",
&amp;nbsp; "dojo/data/ItemFileReadStore",
&amp;nbsp; "dijit/form/ComboBox",
&amp;nbsp; "dojo/_base/json",
&amp;nbsp; "dojo/dom-class",
&amp;nbsp; "dojox/xml/parser",
&amp;nbsp; "esri/config",
&amp;nbsp; "esri/request",
&amp;nbsp; "dojo/domReady!"
&amp;nbsp; ],

function(
&amp;nbsp; declare,
&amp;nbsp; BaseWidget,
&amp;nbsp; on,
&amp;nbsp; lang,
&amp;nbsp; Graphic,
&amp;nbsp; Point,
&amp;nbsp; dom,
&amp;nbsp; ItemFileReadStore,
&amp;nbsp; ComboBox,
&amp;nbsp; dojoJson,
&amp;nbsp; domClass,
&amp;nbsp; xmlParser,
&amp;nbsp; esriConfig,
&amp;nbsp; esriRequest
) {

&amp;nbsp; //To create a widget, you need to derive from BaseWidget.
&amp;nbsp; return declare([BaseWidget], {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // DemoWidget code goes here
&amp;nbsp;&amp;nbsp;&amp;nbsp; baseClass: 'jimu-widget-demo',

&amp;nbsp;&amp;nbsp;&amp;nbsp; postCreate: function() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.inherited(arguments);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('postCreate');
&amp;nbsp;&amp;nbsp;&amp;nbsp; },

&amp;nbsp;&amp;nbsp;&amp;nbsp; startup: function() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.inherited(arguments);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('startup');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //ComboBox til Ejerlavnavn
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*var store;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; store = new ItemFileReadStore({ url: "ejerlav.json" }); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var combo = new ComboBox({ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; store: store,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pageSize: "10" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dom.byId('EjerlavComboBox')); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; combo.startup();*/
&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; onOpen: function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('onOpen');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var map = this.map;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var Long, Lat;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var LocPoint, point;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Go to position
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(this.gotoPosition, 'click', lang.hitch(this, function(evt){ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('gotoPosition ');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.clear();
//WAB already handles the proxy for you so this is not needed&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;&amp;nbsp; //This line creates the error: Uncaught TypeError: Cannot read property 'io' of undefined
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //esriConfig.defaults.io.proxyUrl = "/PHP_proxy/proxy.php";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var url = "your xml url";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var requestHandle = esriRequest({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "url": url,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "handleAs": "xml"
&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;&amp;nbsp; requestHandle.then(requestSucceeded, requestFailed);
&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;&amp;nbsp; function requestSucceeded(response, io){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do something with the xml data
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.info(response, io);
&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;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function requestFailed(error, io){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.info(error, io);
&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;&amp;nbsp; //Lat = this.EjerlavTextBox.value;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Long = this.MatrNrTextBox.value;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lat = 55;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Long = 15;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LocPoint = new Point([Long,Lat]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.centerAndZoom(LocPoint,17);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));
&amp;nbsp;&amp;nbsp;&amp;nbsp; },

&amp;nbsp;&amp;nbsp;&amp;nbsp; onClose: function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('onClose');
&amp;nbsp;&amp;nbsp;&amp;nbsp; },

&amp;nbsp;&amp;nbsp;&amp;nbsp; onMinimize: function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('onMinimize');
&amp;nbsp;&amp;nbsp;&amp;nbsp; },

&amp;nbsp;&amp;nbsp;&amp;nbsp; onMaximize: function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('onMaximize');
&amp;nbsp;&amp;nbsp;&amp;nbsp; },

&amp;nbsp;&amp;nbsp;&amp;nbsp; onSignIn: function(credential){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* jshint unused:false*/
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('onSignIn');
&amp;nbsp;&amp;nbsp;&amp;nbsp; },

&amp;nbsp;&amp;nbsp;&amp;nbsp; onSignOut: function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('onSignOut');
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; });
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:59:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876441#M13602</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T10:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use esriRequest in a widget?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876442#M13603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert, thank you very much it works now &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see you moved &lt;SPAN style="color: #0000ff; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;"dojo/domReady! &lt;/SPAN&gt;to the end of the define list. Was this what caused my problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I want to access xml documents from at different domain I still need the line &lt;SPAN style="color: #008200; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;esriConfig.defaults.io.proxyUrl = "/PHP_proxy/proxy.php";&lt;/SPAN&gt; If I remove the line I get the error: &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;"&lt;EM&gt;esri.config.defaults.io.proxyUrl is not set.&amp;nbsp; If making a request to a CORS enabled server, please push the domain into esri.config.defaults.io.corsEnabledServers&lt;/EM&gt;"&lt;/SPAN&gt;. You mentioned that WAB takes care of this for me, but not in my case. Should I some where in other Web AppBuilder files configure this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2015 23:34:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876442#M13603</guid>
      <dc:creator>MathiasKP</dc:creator>
      <dc:date>2015-11-09T23:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use esriRequest in a widget?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876443#M13604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mathias,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Yes it was the issue with the location of the domReady in your code that threw off the synchronization of your requires and your vars. WAB has a NodeJS proxy setup when you are working in builder. Once you deploy your app then you have to setup a proxy if you are going to use one and specify its url in the main config.json If you need to use a specific proxy while in builder for your app then you can set it in the main config.json for that app just like you would when you deploy the app. Open your apps config.json (i.e. [install dir]\server\apps\[app#]\config.json). Scroll to the bottom of that file and find this section:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;"httpProxy": {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "useProxy": true,
&amp;nbsp;&amp;nbsp;&amp;nbsp; "url": "/proxy.js"
&amp;nbsp; },&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and change it to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;"httpProxy": {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "useProxy": true,
&amp;nbsp;&amp;nbsp;&amp;nbsp; "url": "&lt;SPAN style="color: #008200; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;/PHP_proxy/proxy.php&lt;/SPAN&gt;"
&amp;nbsp; },&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:59:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876443#M13604</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T10:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use esriRequest in a widget?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876444#M13605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I never would have thought that the position of domReady was the problem, but now I know that. I got it to work fine with adding the proxy to config.json.&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 23:24:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-esrirequest-in-a-widget/m-p/876444#M13605</guid>
      <dc:creator>MathiasKP</dc:creator>
      <dc:date>2015-11-10T23:24:20Z</dc:date>
    </item>
  </channel>
</rss>

