<?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: share config files in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828177#M8034</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Sure you could do this by manually setting the config file path in the main config to a common config file. The builder app will always handle the assignment of the widgets config file automatically in code though and you would just need to switch it manually.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Nov 2015 18:54:13 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2015-11-06T18:54:13Z</dc:date>
    <item>
      <title>share config files</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828176#M8033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks to Robert and others for helping our community with their custom widgets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I personally use Robert's Identify, LocalLayer widgets to identify a few. Each of these widgets have their own configuration files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since most of the times the layers that are utilized in the widgets are the same, I found myself to duplicate most of the configuration in each widget configuration.&lt;/P&gt;&lt;P&gt;It would be ideal, if the widgets could share the same config file. So, in the config.json the widgets point to the same config file.&lt;/P&gt;&lt;P&gt;Comments?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example in the config.json&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"widgetPool": {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ...........................&lt;/P&gt;&lt;P&gt;....................................&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "widgets": [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "name": "Identify",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "label": "Identify",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "version": "1.2.0.2",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "IsController": false,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "uri": "widgets/Identify/Widget",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "config": "configs/COMMON/config.json",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "index": 4,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "id": "widgets_Identify_Widget_54"&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;"widgetOnScreen": {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "widgets": [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "uri": "widgets/LocalLayer/Widget",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "id": "widgets_LocalLayer_Widget_55",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "name": "LocalLayer",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "label": "Local Layer Widget",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "config": "configs/COMMON/config.json",&lt;/P&gt;&lt;P&gt;&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 18:46:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828176#M8033</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2015-11-06T18:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: share config files</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828177#M8034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Sure you could do this by manually setting the config file path in the main config to a common config file. The builder app will always handle the assignment of the widgets config file automatically in code though and you would just need to switch it manually.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 18:54:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828177#M8034</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-11-06T18:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: share config files</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828178#M8035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's what I thought. When I tried this, the wab wouldn't even render the page. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; "name": "Identify",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "label": "Identify",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "version": "1.2.0.2",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "IsController": false,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "uri": "widgets/Identify/Widget",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "config": "configs/LocalLayer/config_Local Layer Widget.json"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "index": 4,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "id": "widgets_Identify_Widget_54"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 19:00:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828178#M8035</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2015-11-06T19:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: share config files</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828179#M8036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; even though the layer object at similar they need to be identical. Have you checked that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 20:46:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828179#M8036</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-11-06T20:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: share config files</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828180#M8037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure how this will work. Since the config_identify.json file has some settings before the layers object, the identity tool need to access these settings to initialize the widget. By modifying the config.json as I posted above, the identify widget will not have access to the settings (since the LocalLayer config file does not have them), and therefore it will fail. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 21:37:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828180#M8037</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2015-11-06T21:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: share config files</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828181#M8038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Leftris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Sorry I should have been more explicit. You would have to add all the parameters from the Identify widget to the combined_config.json file so anything not in the Identify widget config needs to be added to the LL config json.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Nov 2015 00:00:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828181#M8038</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-11-07T00:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: share config files</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828182#M8039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I saw you had another question about a select in your widgets html. I don't see that question any more but just in case here is some comments on your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;/*global define*/
define([
&amp;nbsp; 'dojo/_base/declare',
&amp;nbsp; 'dijit/_WidgetsInTemplateMixin',
&amp;nbsp; 'dojo/on',
&amp;nbsp; 'dojo/_base/array',
&amp;nbsp; 'jimu/BaseWidget',
&amp;nbsp; 'dojo/_base/lang',
&amp;nbsp; 'jimu/LayerInfos/LayerInfos',
&amp;nbsp; /*I try to put all dojo/dijit items that are needed for the html but not for use in the js code last in the list*/
&amp;nbsp; 'dijit/form/Select'
],

&amp;nbsp; function (
&amp;nbsp;&amp;nbsp;&amp;nbsp; declare,
&amp;nbsp;&amp;nbsp;&amp;nbsp; _WidgetsInTemplateMixin,
&amp;nbsp;&amp;nbsp;&amp;nbsp; on,
&amp;nbsp;&amp;nbsp;&amp;nbsp; array,
&amp;nbsp;&amp;nbsp;&amp;nbsp; BaseWidget,
&amp;nbsp;&amp;nbsp;&amp;nbsp; lang,
&amp;nbsp;&amp;nbsp;&amp;nbsp; LayerInfos
&amp;nbsp; ) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; //To create a widget, you need to derive from BaseWidget.
&amp;nbsp;&amp;nbsp;&amp;nbsp; return declare([BaseWidget, _WidgetsInTemplateMixin], {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; baseClass: 'jimu-widget-BufferSelection',

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; postCreate: function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.inherited(arguments);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; startup: function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.inherited(arguments);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Because layerinfos is a defered you need to lang hitch so that "this" is in the proper scope*/
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LayerInfos.getInstance(this.map, this.map.itemInfo).then(lang.hitch(this, function (layerInfosObject) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.resultLayers = [];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Because getLayerInfoArray is a defered you need to lang hitch so that "this" is in the proper scope*/
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfosObject.getLayerInfoArray().forEach(lang.hitch(this, function (layerInfo, index) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var option = {
&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; value: index,
&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; label: layerInfo.title
&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;&amp;nbsp; //console.log(layerInfo);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.resultLayers.push(option);
&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; this.select1.addOption(this.resultLayers);
&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; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:58:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828182#M8039</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T09:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: share config files</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828183#M8040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Robert. Yes, I deleted the posts because I thought it was a simple and naive question and I should try a bit harder to try it out. I keep forgetting to keep the scope of the function with the lang.hitch.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2015 18:19:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/share-config-files/m-p/828183#M8040</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2015-11-09T18:19:43Z</dc:date>
    </item>
  </channel>
</rss>

