<?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 to create a custom config? in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814592#M6852</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;Thank you for your response. I am still confused on this. I was thinking that by creating my custom config.json in the root path and accessing it via the config.json by changing the&amp;nbsp;config.json's config paths in my widget definitions that my custom widget would be available within the widget.js files. Can you explain why that is not the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example the&amp;nbsp;config.json has a reference to myWidget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt; "position": {&lt;BR /&gt; "left": 57,&lt;BR /&gt; "bottom": 70,&lt;BR /&gt; "relativeTo": "map"&lt;BR /&gt; },&lt;BR /&gt; "placeholderIndex": 2,&lt;BR /&gt; "id": "_26",&lt;BR /&gt; "uri": "widgets//&lt;SPAN&gt;myWidget&lt;/SPAN&gt;//Widget",&lt;BR /&gt; "icon": "configs\\icon__26.png",&lt;BR /&gt; "name": "&lt;SPAN&gt;myWidget&lt;/SPAN&gt;",&lt;BR /&gt; "config": "configs/myWidget/config__26.json",&lt;BR /&gt; "IsController": false,&lt;BR /&gt; "version": "0.0.1"&lt;BR /&gt; },&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here it references a config file - &lt;SPAN&gt;"config": "&lt;/SPAN&gt;&lt;SPAN&gt;configs&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;myWidget/&lt;/SPAN&gt;&lt;SPAN&gt;config__26.json",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the current contents of the config file.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"serviceUrl":"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUSA%2FMapServer" rel="nofollow" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer&lt;/A&gt;&lt;SPAN&gt;"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because I have a total of five widgets that potentially all need access to the same rest endpoint URL I would prefer to list those URL's in one file in the parent root of the directory so all my widgets can use the same file. As opposed to customizing all the config files in the "configs/WidgetName" directory path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have changed the root config.json's myWidget config path as such:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"config": "myconfig&lt;/SPAN&gt;&lt;SPAN&gt;.json",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So now my widgets point to myconfig.json in the same parent root directory as the original config.json file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So why can't this be seen, why do I have to use esriRequest?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My myconfig.json file contains&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;BR /&gt; "serviceName": "SERVICENAME",&lt;BR /&gt; "oneUrl": "//myPortal/server/rest/services/NAME/FeatureServer/1",&lt;BR /&gt; "twoUrl": "//myPortal/server/rest/services/N&lt;SPAN&gt;AME&lt;/SPAN&gt;/FeatureServer/2",&lt;BR /&gt; "threeUrl": "//myPortal/server/rest/services/N&lt;SPAN&gt;AME&lt;/SPAN&gt;/FeatureServer/3",&lt;BR /&gt; "fourUrl": "//myPortal/server/rest/services/N&lt;SPAN&gt;AME&lt;/SPAN&gt;/FeatureServer/4"&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So then within my widget.js files I want to be able to access the information in the myconfig.json.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var myconfig = How ever I instantiate my custom config file here;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var serviceName = myconfig.SERVICENAME;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var oneURL = myconfig.oneURL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Or by just using the reference to myconfig directly in place of individual variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SomethingThatNeedsTheONEURLPath = myconfig.oneURL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't understand how to access the information within myconfig.json after following your provided code example. Can you please be more specific. It appears that "myConfig" in your example is instantiated but I don't understand how to access the information contained within the "myConfig" file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Again, if there is a better, easier way of doing this I am open to suggestions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank You,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Greg&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Sep 2018 16:13:31 GMT</pubDate>
    <dc:creator>GregRieck</dc:creator>
    <dc:date>2018-09-18T16:13:31Z</dc:date>
    <item>
      <title>How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814590#M6850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have several widgets the reference rest end point URL's. I would like to be able to use a config file in the root folder of the WAB site to store the path to these URL's. I have found the config.json file in the root directory. Within the config.json file I have changed the "config": path from "configs/..." path to the root, ie "config": "mycustom.json".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mycustom.json has a reference to a rest end point&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;"myUrl":&amp;nbsp;"'//myportal.com/server/rest/services/SiteName/FeatureServer/SomeNumber'",&lt;/P&gt;&lt;P&gt;additional urls.....&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now how do I access mycustom.json within the individual widget.js files?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var myurl =&amp;nbsp;??. mycustom.json.???myUrl????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I am off base with this approach please let me know. I didn't want to have a separate config file for each widget as each widget would be using the same URL's in the config file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 00:49:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814590#M6850</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2018-09-18T00:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814591#M6851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Because it is a custom .json file you will have to use esriRequest to get the file:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; myConfig &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;esriRequest&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'mycustom.json'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp; content&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"json"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp; handleAs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"json"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
myConfig&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;then&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;response&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;info&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;response&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;error&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Error: "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; error&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:36:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814591#M6851</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T09:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814592#M6852</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;Thank you for your response. I am still confused on this. I was thinking that by creating my custom config.json in the root path and accessing it via the config.json by changing the&amp;nbsp;config.json's config paths in my widget definitions that my custom widget would be available within the widget.js files. Can you explain why that is not the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example the&amp;nbsp;config.json has a reference to myWidget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt; "position": {&lt;BR /&gt; "left": 57,&lt;BR /&gt; "bottom": 70,&lt;BR /&gt; "relativeTo": "map"&lt;BR /&gt; },&lt;BR /&gt; "placeholderIndex": 2,&lt;BR /&gt; "id": "_26",&lt;BR /&gt; "uri": "widgets//&lt;SPAN&gt;myWidget&lt;/SPAN&gt;//Widget",&lt;BR /&gt; "icon": "configs\\icon__26.png",&lt;BR /&gt; "name": "&lt;SPAN&gt;myWidget&lt;/SPAN&gt;",&lt;BR /&gt; "config": "configs/myWidget/config__26.json",&lt;BR /&gt; "IsController": false,&lt;BR /&gt; "version": "0.0.1"&lt;BR /&gt; },&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here it references a config file - &lt;SPAN&gt;"config": "&lt;/SPAN&gt;&lt;SPAN&gt;configs&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;myWidget/&lt;/SPAN&gt;&lt;SPAN&gt;config__26.json",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the current contents of the config file.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"serviceUrl":"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUSA%2FMapServer" rel="nofollow" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer&lt;/A&gt;&lt;SPAN&gt;"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because I have a total of five widgets that potentially all need access to the same rest endpoint URL I would prefer to list those URL's in one file in the parent root of the directory so all my widgets can use the same file. As opposed to customizing all the config files in the "configs/WidgetName" directory path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have changed the root config.json's myWidget config path as such:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"config": "myconfig&lt;/SPAN&gt;&lt;SPAN&gt;.json",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So now my widgets point to myconfig.json in the same parent root directory as the original config.json file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So why can't this be seen, why do I have to use esriRequest?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My myconfig.json file contains&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;BR /&gt; "serviceName": "SERVICENAME",&lt;BR /&gt; "oneUrl": "//myPortal/server/rest/services/NAME/FeatureServer/1",&lt;BR /&gt; "twoUrl": "//myPortal/server/rest/services/N&lt;SPAN&gt;AME&lt;/SPAN&gt;/FeatureServer/2",&lt;BR /&gt; "threeUrl": "//myPortal/server/rest/services/N&lt;SPAN&gt;AME&lt;/SPAN&gt;/FeatureServer/3",&lt;BR /&gt; "fourUrl": "//myPortal/server/rest/services/N&lt;SPAN&gt;AME&lt;/SPAN&gt;/FeatureServer/4"&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So then within my widget.js files I want to be able to access the information in the myconfig.json.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var myconfig = How ever I instantiate my custom config file here;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var serviceName = myconfig.SERVICENAME;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var oneURL = myconfig.oneURL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Or by just using the reference to myconfig directly in place of individual variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SomethingThatNeedsTheONEURLPath = myconfig.oneURL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't understand how to access the information within myconfig.json after following your provided code example. Can you please be more specific. It appears that "myConfig" in your example is instantiated but I don't understand how to access the information contained within the "myConfig" file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Again, if there is a better, easier way of doing this I am open to suggestions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank You,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Greg&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 16:13:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814592#M6852</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2018-09-18T16:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814593#M6853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sorry I forgot that you where changing the main config.json to have the widget use your custom json file. In that case then the widget default config that is loaded is your custom json and you can access it as simple as:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;config&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;‍serviceName
&lt;SPAN class="comment token"&gt;//or &lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;config&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;one‍‍‍Url&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:36:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814593#M6853</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T09:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814594#M6854</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;No problem. See that's what I would of thought as well, this.config.serviceName. However, config is undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is on "Window" and I couldn't find any reference to my config file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 17:02:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814594#M6854</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2018-09-18T17:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814595#M6855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;Greg,&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp; If “this” is referencing window then your scope that you are trying to use this.config in is not hitched to the proper scope. Can you show me the code block that you are calling it from?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 17:30:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814595#M6855</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-09-18T17:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814596#M6856</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'm just inside /widgets/MyWidget/Widget.js&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a large js widget - I've only include the top portion where I am trying to define and access myConfig file. I suspected a scope issue as well. But I'm not sure how to access variables outside the current /widgets/MyWidget scope.&lt;/P&gt;&lt;P&gt;If you need the enitre file I can do that but would prefer to send it securely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define([&lt;BR /&gt; 'dgrid/OnDemandGrid',&lt;BR /&gt; 'dgrid/Selection',&lt;BR /&gt; 'dgrid/extensions/ColumnResizer',&lt;BR /&gt; 'dgrid/extensions/ColumnHider',&lt;BR /&gt; 'dijit/Menu',&lt;BR /&gt; 'dijit/MenuSeparator',&lt;BR /&gt; 'dijit/MenuItem',&lt;BR /&gt; 'dijit/PopupMenuItem',&lt;BR /&gt; 'dojo/_base/declare',&lt;BR /&gt; 'dojo/_base/lang',&lt;BR /&gt; 'dojo/_base/array',&lt;BR /&gt; 'dojo/store/Memory',&lt;BR /&gt; 'dojo/dom',&lt;BR /&gt; 'dojo/on',&lt;BR /&gt; 'dojo/dom-construct',&lt;BR /&gt; 'dojo/parser',&lt;BR /&gt; 'dojo/mouse',&lt;BR /&gt; 'esri/Color',&lt;BR /&gt; 'esri/graphic',&lt;BR /&gt; 'esri/request',&lt;BR /&gt; 'esri/tasks/query',&lt;BR /&gt; 'esri/layers/FeatureLayer',&lt;BR /&gt; 'esri/symbols/SimpleLineSymbol',&lt;BR /&gt; 'esri/symbols/PictureMarkerSymbol',&lt;BR /&gt; 'esri/layers/GraphicsLayer',&lt;BR /&gt; 'esri/tasks/query',&lt;BR /&gt; 'esri/tasks/QueryTask',&lt;BR /&gt; 'esri/geometry/mathUtils',&lt;BR /&gt; 'esri/map',&lt;BR /&gt; 'esri/SpatialReference',&lt;BR /&gt; 'esri/geometry/Polyline',&lt;BR /&gt; 'esri/geometry/Point',&lt;BR /&gt; 'esri/geometry/geometryEngine',&lt;BR /&gt; 'esri/tasks/GeometryService',&lt;BR /&gt; 'esri/tasks/ProjectParameters',&lt;BR /&gt; 'esri/geometry/webMercatorUtils',&lt;BR /&gt; 'esri/symbols/SimpleMarkerSymbol',&lt;BR /&gt; 'jimu/dijit/LoadingShelter',&lt;BR /&gt; 'jimu/SelectionManager',&lt;BR /&gt; 'jimu/BaseWidget'&lt;BR /&gt;], function (&lt;BR /&gt; Grid, Selection, ColumnResizer, ColumnHider,&lt;BR /&gt; Menu, MenuSeparator, MenuItem, PopupMenuItem, &lt;BR /&gt; declare, lang, arrayUtils, Memory, DOM, on, domConstruct, parser, mouse,&lt;BR /&gt; Color, Graphic, esriRequest, Query, FeatureLayer, SimpleLineSymbol, PictureMarkerSymbol,&lt;BR /&gt; GraphicsLayer, Query, QueryTask, mathUtils, Map, SpatialReference, Polyline, Point, geometryEngine,&lt;BR /&gt; GeometryService, ProjectParameters, webMercatorUtils, SimpleMarkerSymbol,&lt;BR /&gt; LoadingShelter, SelectionMgr, BaseWidget&lt;BR /&gt;) {&lt;BR /&gt; parser.parse();&lt;BR /&gt; var pl;&lt;BR /&gt; var lineLength;&lt;BR /&gt; var SVG = "M23.963,20.834L17.5,9.64c-0.825-1.429-2.175-1.429-3,0L8.037,20.834c-0.825,1.429-0.15,2.598,1.5,2.598h12.926C24.113,23.432,24.788,22.263,23.963,20.834z";&lt;BR /&gt; var posAlong = new Graphic();&lt;BR /&gt; &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;var&amp;nbsp;oneUrl = this.myConfigFileNameHere.oneUrl;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 17:41:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814596#M6856</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2018-09-18T17:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814597#M6857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That code looks a little strange. Normally I would see&lt;/P&gt;&lt;P&gt;return declare([BaseWidget], {&lt;/P&gt;&lt;P&gt;Before where you have parser.parse(); (which is should really never be used inside a widget). If you have dijits/widget inside your widget then you need:&lt;/P&gt;&lt;P&gt;return declare([BaseWidget, &lt;STRONG&gt;_WidgetsInTemplateMixin&lt;/STRONG&gt;], {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next thing that is off is you have all these vars after parser.parse(); Normally in widget development you have vars like:&lt;/P&gt;&lt;P&gt;baseClass: 'jimu-widget-identify',&lt;/P&gt;&lt;P&gt;mySpecialVar: null,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next based on widget lifecycle you need to be getting the this.config.oneUrl; inside a function like postCreate or startup.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 19:03:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814597#M6857</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-09-18T19:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814598#M6858</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;Yes, I do have return declare([BaseWidget], { further down. The parser is used for SVG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I attempt to get my custom config file from "this" inside the postCreate: function I see a "config:" and when expanded I see the data within my custom json file. So, it's not using my custom name but rather "config:". But when I try to access "this.config" it is undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to see the entire widget.js file I would need a secure way of sending it to you. I do not feel comfortable placing the entire contents here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 20:44:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814598#M6858</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2018-09-18T20:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814599#M6859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I would not be trying to use your custom name as you have told the widget that it's default config variable is suppose to point to your custom json file in the apps root (because you made that change in the main config.json). So forget about any notion of your custom widget config having some other name as it will juts be config.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 20:52:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814599#M6859</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-09-18T20:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814600#M6860</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;this.config.oneUrl is not defined in postCreate but it is available and accessible in the startup function. Thank you for the help on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 21:21:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814600#M6860</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2018-09-18T21:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814601#M6861</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 found another location where it would be helpful to be able to use the name value pair from my config file. It's in a FeatureAction in a couple of my widgets. Do you know how I can get access to "this.config" within a FeatureAction?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 01:19:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814601#M6861</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2018-09-20T01:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom config?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814602#M6862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; A FeatureAction does not have any tie back to a widget so there is no access to a widget config by default. The only way to get this would be to find the widget using WidgetManager&amp;nbsp;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;getWidgetsByName function and then you could get the widgets config.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 12:53:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-create-a-custom-config/m-p/814602#M6862</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-09-20T12:53:55Z</dc:date>
    </item>
  </channel>
</rss>

