<?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: Layerlist widget with only one layer can be expanded in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832709#M8454</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was having the same issue as you mentioned and I was able to resolve the issue by using below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt; When adding multiple ArcGISDynamicMapServiceLayer to the map. The layers in LayerList widget expand only one layer and rest won't expand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reason:&lt;/STRONG&gt; As Robert mentioned when you are adding multiple layers at the same time, layer nodes are not added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Solution:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;//Create an array to hold all new layers&lt;/P&gt;&lt;P&gt;this.dynamicLayers = [];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Add all dynamic layer to array&lt;/P&gt;&lt;P&gt;this.dynamicLayers.push(dynamicLayer1);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this.dynamicLayers.push(dynamicLayer2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this.dynamicLayers.push(dynamicLayer3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this.dynamicLayers.push(dynamicLayer4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (this.dynamicLayers.length &amp;gt; 0) {&lt;BR /&gt;//setTimeout is requried for multiple dynamic layer, else layer list node expand issue is there.&lt;BR /&gt;setTimeout(lang.hitch(this, function () {&lt;/P&gt;&lt;P&gt;//Use addLayers() to add multiple layers.&lt;BR /&gt;this.map.addLayers(this.dynamicLayers); &lt;BR /&gt;}), 500); &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun E&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Dec 2018 21:38:11 GMT</pubDate>
    <dc:creator>arunepuri1</dc:creator>
    <dc:date>2018-12-04T21:38:11Z</dc:date>
    <item>
      <title>Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832694#M8439</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 a customized widget which load several layers:&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;array.forEach(this.config.layers, function (layer) {&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.addLayerToMap(layer);&lt;BR /&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;&amp;nbsp;&amp;nbsp; }, this);&lt;/P&gt;&lt;P&gt;When I open the LayerList widget (the build-in widget from web appbuilder 2.8 - &lt;A class="link-titled" href="https://doc.arcgis.com/en/web-appbuilder/create-apps/widget-layer-list.htm" title="https://doc.arcgis.com/en/web-appbuilder/create-apps/widget-layer-list.htm"&gt;Layer List widget—Web AppBuilder for ArcGIS | ArcGIS&lt;/A&gt; ), only one layer can be expanded. With the same code, if the "layers" array only has one layer, this layer is expandable in the LayerList widget. Does anybody else has the same issue? Can LayerList be customized to work when multiple layers added at a time?&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/411254_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 18:44:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832694#M8439</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2018-06-12T18:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832695#M8440</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; &amp;nbsp;What errors if any are present in the web console when you try to expand those?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 18:47:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832695#M8440</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-06-12T18:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832696#M8441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert, I don't see any error message in the web debug window's console section. I have noticed that in LayerListView.js file, only one layer's sublayer goes to line 100 to place subnode.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/411256_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 19:40:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832696#M8441</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2018-06-12T19:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832697#M8442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That means when it is looping through the new layers you added it does not see any sublayers for them. Is that not the case for those layers?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 19:49:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832697#M8442</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-06-12T19:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832698#M8443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert, The map service has sublayers (at least one). if I use the same code and assign only one layer to the layers array (the same layer that has issue being expanded), the layer listed in the layerlist is able to be expanded.&lt;/P&gt;&lt;P&gt;In the screenshot before, Zoning Info is not expandable when added with other layers the same time. When manually add one value to the "Layer" array. It is expandable.Thanks&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/411270_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 19:58:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832698#M8443</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2018-06-12T19:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832699#M8444</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; &amp;nbsp;Strange I have never seen that behavior. How are those layers being added to the map? Is it through a custom widget or code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 20:06:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832699#M8444</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-06-12T20:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832700#M8445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is through a customized widget that I customized from the Addlayer widget (&lt;A href="https://community.esri.com/docs/DOC-7629"&gt;AddLayer Widget&lt;/A&gt;&amp;nbsp;). The original widget is used to add one layer when a check box is checked. It works with the layerlist which expands the layer node. What I have customized is to add a dijit/form/Select above the layer list in the widget.html. When the value changes in the select, a few map services are added to the map. The map services are added to the map in a loop. I have also noticed that Web AppBuilder build-in Legend widget only display the legend for the layer which is expandable in the layerlist widget.&lt;/P&gt;&lt;P&gt;Here is the code which load a few map services. addLayerToMap is reused from the original code. Themelayers is the array of IDs for map services which will be loaded in the map.&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;array.forEach(this.config.layers, function (layer) {&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (themeLayers.indexOf(layer.name) != -1) //find the fire&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //1. Check box checked&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var cb = registry.byId(layer.name);&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cb.setValue(true);&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //2. Load layer to map&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.addLayerToMap(layer);&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&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;&amp;nbsp;&amp;nbsp; }, this);&lt;/P&gt;&lt;P&gt;The screenshot below shows when Planning is selected, map services "Other Info", "Small CellInfo", "Trans Plan Info" are loaded to the map.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/411271_pastedImage_1559.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 21:27:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832700#M8445</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2018-06-12T21:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832701#M8446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;After further debugging, I found that in LayerListView,js, the layer that is expandable has newSubLayers length &amp;gt;0. And the layer that is non-expandable has the newSubLayers length property as 0. The layer is loaded as map service which obviously has at least one sublayer.&lt;/P&gt;&lt;P&gt;As I said before, when I load only one map service (same map service url), the newSubLayer length is &amp;gt; 0.&lt;/P&gt;&lt;P&gt;Do you know what will be the reason?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;P&gt;Load with other map services&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/411287_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;P&gt;VS - load as the only map service&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-4" src="https://community.esri.com/legacyfs/online/411289_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 21:35:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832701#M8446</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2018-06-12T21:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832702#M8447</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; &amp;nbsp;It has to be something in your code with the layer creation or the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;addLayerToMap function then.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 12:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832702#M8447</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-06-13T12:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832703#M8448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rober,&lt;/P&gt;&lt;P&gt;Thanks for help, It doesn't look like the customized code has something. I have created a very simple WAB application at this location &lt;A class="link-titled" href="https://testgis2.arlingtontx.gov/test/" title="https://testgis2.arlingtontx.gov/test/"&gt;Test LayerList WAB&lt;/A&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;If I select add one map service from the drop down list, 911 is added to the map which is expandable. But I I choose add 2 map services from the drop down list, USA and Census are added to the map, only one layer is expandable. It looks random, my IE has USA expandable and Google has Census expandable.And the legend only lists the layers that are expandable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have changed my code to be this simple by loading map service url this way-&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer("&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%2FCensus%2FMapServer" rel="nofollow" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer&lt;/A&gt;&lt;SPAN&gt;", &lt;/SPAN&gt;&lt;BR /&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;{"id" : "census", opacity: 0.5});&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;&amp;nbsp;&amp;nbsp; this.map.addLayer(dynamicMapServiceLayer);&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;/P&gt;&lt;P&gt;Thanks so much for help.&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 16:17:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832703#M8448</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2018-06-13T16:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832704#M8449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert, One more note - No customization for Layer list and Legend - they are build-in from Web Appbuilder 2.8. Thanks&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 16:34:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832704#M8449</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2018-06-13T16:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832705#M8450</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; &amp;nbsp;What I am saying is that if you use an OTB widget not custom code to add your layers you will not encounter this issue so the issue has to be in your code for adding the multiple layers. Maybe it is the fact that you are adding the layers in a loop and the layerlist widget does not have enough time to catch the changes. One way to test my theory is to add a setTimeout before you add the next layer. Another thing I would try is to get a reference to the Layer List widget and call it's layerListView.refresh() method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:13:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832705#M8450</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-06-13T19:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832706#M8451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert, I have setTimeout when loading a layer. It still behaves the same - only one layer is expandable. I will dig more in the layerlist widget code to see how the refresh is triggered.&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 14:48:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832706#M8451</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2018-06-14T14:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832707#M8452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;I have had another finding. Your identify wdiget in my WAB application only display feature information for expandable loaded maps services. I am able to debugging your identify widget.js and find out that problem layers have newSubLayer length = 0.&amp;nbsp; So I am guessing in the WAB, there is an event triggered when new layers are added - something like LayerInfosChange in jimu. The change event has effects on all widgets which use map's operLayerInfos across in WAB applications, including layerlist, legend and identify, maybe others. Do you know if such an event exists?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 17:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832707#M8452</guid>
      <dc:creator>HelenZhou</dc:creator>
      <dc:date>2018-06-14T17:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832708#M8453</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; &amp;nbsp;In the jimu\LayerInfos\LayerInfos.js there is the _bindEvents function that listens for new layers being added to the map.&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;handleAdd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"layer-add-result"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lang&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_onLayersChange&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; clazz&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ADDED&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 18:38:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832708#M8453</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-06-14T18:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Layerlist widget with only one layer can be expanded</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832709#M8454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was having the same issue as you mentioned and I was able to resolve the issue by using below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt; When adding multiple ArcGISDynamicMapServiceLayer to the map. The layers in LayerList widget expand only one layer and rest won't expand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reason:&lt;/STRONG&gt; As Robert mentioned when you are adding multiple layers at the same time, layer nodes are not added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Solution:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;//Create an array to hold all new layers&lt;/P&gt;&lt;P&gt;this.dynamicLayers = [];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Add all dynamic layer to array&lt;/P&gt;&lt;P&gt;this.dynamicLayers.push(dynamicLayer1);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this.dynamicLayers.push(dynamicLayer2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this.dynamicLayers.push(dynamicLayer3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this.dynamicLayers.push(dynamicLayer4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (this.dynamicLayers.length &amp;gt; 0) {&lt;BR /&gt;//setTimeout is requried for multiple dynamic layer, else layer list node expand issue is there.&lt;BR /&gt;setTimeout(lang.hitch(this, function () {&lt;/P&gt;&lt;P&gt;//Use addLayers() to add multiple layers.&lt;BR /&gt;this.map.addLayers(this.dynamicLayers); &lt;BR /&gt;}), 500); &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun E&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2018 21:38:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layerlist-widget-with-only-one-layer-can-be/m-p/832709#M8454</guid>
      <dc:creator>arunepuri1</dc:creator>
      <dc:date>2018-12-04T21:38:11Z</dc:date>
    </item>
  </channel>
</rss>

