<?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: Widget to turn on/off layers? (No, not the Layerlist.) in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764825#M1042</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Robert... I stumbled upon this after posting my question and looked at your sample. Sounds like this might do the trick. Stay tuned... I may have some questions on how to tweak his.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Dec 2019 03:29:06 GMT</pubDate>
    <dc:creator>Arne_Gelfert</dc:creator>
    <dc:date>2019-12-18T03:29:06Z</dc:date>
    <item>
      <title>Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764823#M1040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As noted in another post just minutes ago,&amp;nbsp;I'm in the process of converting some existing custom Geocortex tools to ESRI WAB or JSAPI web functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Geocortex offers the apparently rather popular Themes concept in their framework. It's a way to &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;group a number of layers into a theme and then turn layers on/off by switching from one theme to another.&lt;/EM&gt;&lt;/SPAN&gt; So you'd either pick a&amp;nbsp;selection from a dropdown, or with only two choice toggle between two states to activate (turn on) one group layers, thereby turning the other(s) off. &lt;STRONG&gt;QUESTION:&lt;/STRONG&gt; Is there an obvious OTB or available custom widget&amp;nbsp;candidate to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Certainly don't want to make anyone have to interact with the LayerList or TOC to hide or unhide layers. it should be more one-click behavior.&amp;nbsp;I could see how you'd build two web maps from map services in Portal and then flip back and forth between those.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's quite easy to build this using the JavaScript API. All you need is a HTML dropdown element with some event handlers that then turn on/off layers. Unfortunately, I have not been able to twist my brain into a shape that would allow me to decipher custom WAB widgetry .&amp;nbsp;So hoping that someone has used one of the available widgets for this purpose?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2019 20:25:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764823#M1040</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2019-12-17T20:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764824#M1041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arne,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You will want to look at using this widget. It allows you to click the widget button and turn on/off one or more layers in the map.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/docs/DOC-8592-layer-toggle-button-widget-version-212-08282019"&gt;https://community.esri.com/docs/DOC-8592-layer-toggle-button-widget-version-212-08282019&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2019 23:02:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764824#M1041</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-12-17T23:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764825#M1042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Robert... I stumbled upon this after posting my question and looked at your sample. Sounds like this might do the trick. Stay tuned... I may have some questions on how to tweak his.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2019 03:29:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764825#M1042</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2019-12-18T03:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764826#M1043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, your LayerToggleButton works like a charm. Now, let me ask you this: Would this be a good candidate to heed your repeated advice and encouragement to dig into the jimu jambalaya to adapt for my purposes?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I wanted to&amp;nbsp;change&amp;nbsp;the behavior to be:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use a dropdown widget: Basically you pick&amp;nbsp;your layer or group of layers from a dropdown.&lt;/LI&gt;&lt;LI&gt;Selection of that layer(s) turn on that layer(s) and turn of all other layers&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What changes would be needed? I'm assuming...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;LayerSelector.html would need to&amp;nbsp;get a dropdown. I'm not familiar with all the dojo/jimu elements but&amp;nbsp;I can figure it out.&lt;/LI&gt;&lt;LI&gt;LayerSelector.js - I&amp;nbsp;can't even begin to wrap my brain around this yet. A lot of this is just needed to make the widget configurable, right? I suspect, there would have to be a way to&amp;nbsp;name your elements for the dropdown and assign layers to each, provided it's not a 1:1 but groups of layers getting assigned to one dropdown item. How much of this could be gutted if I didn't&amp;nbsp;need it to be configurable but was able to just hard code&amp;nbsp;which layers correspond to which element in a list of&amp;nbsp;dropdown items that i define?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you ever considered writing a book about all this? Seems like based on all the Geonet posts of yours I have read, you'd be the&amp;nbsp;right one to do it. I find that without some decent tutorial, I will never have enough cycles to dedicate to this, and will likely have to&amp;nbsp;get some outside help.&amp;nbsp;Which is a huge disappointment in ESRI. But you have to be realistic. Anyway, I'll go through the code with a fine tooth comb and see what nuggets I can tease out of you with my next post.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2019 16:23:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764826#M1043</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2019-12-18T16:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764827#M1044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arne,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;So the whole LayerSelector portion of the widget is just for widget configure-ability in the widget settings UI. If you want to hard code the layers that will be toggled then you do not need that at all. So the biggest thing you need to do is create a widget.html and widget.js that has a dropdown and then wire up the change event to fire off the code to toggle the layers based on the selected value. So consider that the layer toggle widget has very little code that actually does the toggling. In the toggleLayer method is where the real work occurs. I use the&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/web-appbuilder/api-reference/layerstructure.htm" title="https://developers.arcgis.com/web-appbuilder/api-reference/layerstructure.htm"&gt;LayerStructure class—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;to traverse all layers and hide them then I use lObjs array to that get populated in the onOpen method to&amp;nbsp;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;lObj&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;toggle&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the onOpen I use layerStructure.getNodeById to get the layer object based on the layer object id in the config.json of the widget.&amp;nbsp;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #569cd6;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;lObjs&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;=&amp;nbsp;[];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;map&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;toggleLayerIds&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;lang&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;hitch&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;){&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;lyrNode&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;layerStructure&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;getNodeById&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;lObjs&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;push&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;lyrNode&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}));&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;So each layer has an id assigned to it in the WAB map (this is Not the name of the layer or something simple you would know). I.e.&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;"LOJIC_LandRecords_Louisville_4356"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;You can find these ids by inspecting the LayerList widget dom using developer tools.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So first things first.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;build your widgets UI with a drop down.&lt;/LI&gt;&lt;LI&gt;have a change event on the drop down.&lt;/LI&gt;&lt;LI&gt;have that change event based on the value of the drop down show or hide layers using a if statement or a js switch statement.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The gotchas to look out for when you get to the actual showing or hiding the layers is that if the layer is visible and you call&amp;nbsp;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;lObj&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;show&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;This causes an issue in the code. So don't call show() or hide() on a layer that is already in that visible state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2019 13:52:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764827#M1044</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-12-19T13:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764828#M1045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was great. I will start sifting through all this tomorrow. Thanks for sharing your&amp;nbsp;insights and making this mystery accessible!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2019 21:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764828#M1045</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2019-12-19T21:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764829#M1046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3101" target="_blank"&gt;Robert Scheitlin, GISP&lt;/A&gt;, 3 weeks on, and I'm finally getting back to this. I read over your instructions up there, and I think I hear&amp;nbsp;what you're saying. It's just still seems too much at once for my first round of widgetry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So instead, I'm starting with this for widget.html and using &lt;A href="https://dojotoolkit.org/reference-guide/1.10/dijit/form/Select.html" rel="nofollow noopener noreferrer" target="_blank"&gt;dijit/form/Select&lt;/A&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;div&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;select&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;name&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;LayerSelector&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;data-dojo-type&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;dijit/form/Select&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
      &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;option&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;value&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;First Layer&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;First Layer&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;option&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
      &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;option&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;value&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Second Layer&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Second Layer&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;option&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;select&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt; 
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;div&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That gives me&amp;nbsp;this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/478302_layerselector.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great! Then I used the Demo widget as template, added the Mixin's for the dojo dropdown&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;define&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'dojo/_base/declare'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&lt;SPAN class="string token"&gt;'jimu/BaseWidget'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;'dijit/_WidgetsInTemplateMixin'&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;declare&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
     BaseWidget&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
    _WidgetsInTemplateMixin
   &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;declare&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;BaseWidget&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;_WidgetsInTemplateMixin&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;
   baseClass&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'jimu-widget-layerselector'&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="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;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I also kept&amp;nbsp;the following life cycle methods - bare, with only console logging:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;postCreate&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;&lt;SPAN class="punctuation token"&gt;)&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="token function"&gt;inherited&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arguments&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
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;'postCreate'&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;
  
startup&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;&lt;SPAN class="punctuation token"&gt;)&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="token function"&gt;inherited&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arguments&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
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;'startup'&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;
  
onOpen&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;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
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;'onOpen'&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;
  
onClose&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;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
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;'onClose'&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;/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;P&gt;&lt;/P&gt;&lt;P&gt;Then I added an event handler (merely to log the event), based on this &lt;A _jive_internal="true" href="https://community.esri.com/thread/228724-dijitformselect-dynamically-created-change-event" target="_blank"&gt;other thread&lt;/A&gt; where you chimed in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;cbChangedHandler&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;who&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; property&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; oldValue&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   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;who&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; property&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; oldValue&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; newValue&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, how&amp;nbsp;do I rig this up with a event listener? Again, I found the following snippet in your other example:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;this.LayerSelector.watch('displayedValue', lang.hitch(this, this.cbChangedHandler, "LayerSelector"));&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But where does it&amp;nbsp;need to live? Am I generally still on track to widget enlightenment or lost in the woods?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:28:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764829#M1046</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-12T08:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764830#M1047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Widget startup function would be a good place.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jan 2020 21:51:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764830#M1047</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-01-13T21:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764831#M1048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was the first thing I tried, and I get this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;init.js:115 TypeError: Cannot read property 'watch' of undefined
 at Object.startup (Widget.js?wab_dv=2.14:25)
 at Object.advice (init.js:121)
 at Object.c [as startup] (init.js:120)
 at Object.&amp;lt;anonymous&amp;gt; (BaseWidgetPanel.js?wab_dv=2.14:83)
 at init.js:64
 at m (init.js:108)
 at k (init.js:108)
 at e.resolve (init.js:110)
 at Object.&amp;lt;anonymous&amp;gt; (WidgetManager.js?wab_dv=2.14:131)
 at init.js:64 "TypeError: Cannot read property 'watch' of undefined&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:28:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764831#M1048</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-12T08:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764832#M1049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arne,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Because the select object needs a data-dojo-attach-point attribute.&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;&amp;lt;&lt;/SPAN&gt;select &lt;/SPAN&gt;&lt;/CODE&gt;data-dojo-attach-point&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;"&lt;/SPAN&gt;LayerSelector&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;"&lt;/SPAN&gt; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit; font-size: 14px;"&gt;data-dojo-type&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;"&lt;/SPAN&gt;dijit/form/Select&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jan 2020 22:31:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764832#M1049</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-01-13T22:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764833#M1050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice! Sorry&amp;nbsp;I'm thinking in nano-steps.... but I'll try that. I also&amp;nbsp;just pasted some snippet&amp;nbsp;referencing&amp;nbsp;LayerStructure class and that&amp;nbsp;worked. So I'm slooooowly warming up to the Jimujambalaya. Thanks for going the extra miles for all of us out here!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jan 2020 22:39:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764833#M1050</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-01-13T22:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764834#M1051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Added a&amp;nbsp;missing&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;define([..., "dojo/_base/lang", ...]&lt;P&gt;function(..., lang,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;, ... )&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;and I'm off to the races!&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jan 2020 22:52:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764834#M1051</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-01-13T22:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Widget to turn on/off layers? (No, not the Layerlist.)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764835#M1052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3101" target="_blank"&gt;Robert Scheitlin, GISP&lt;/A&gt;‌, thanks for getting me off the ground here. All the sudden, there is a faint shimmer of light at the end of the tunnel! Got my even handler working.&amp;nbsp;If Layers are called Layer1, Layer2, Layer3, then all I do is:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function updateLayerVisibility(oldValue,newValue) {
       layerStructure.traversal(function(layerNode) {
             if (layerNode.title.includes(oldValue)) 
                 {layerNode.hide();}
             if (layerNode.title.includes(newValue)) 
                 {layerNode.show()};
       });
}&lt;/PRE&gt;&lt;P&gt;So if the current dropdown value "Layer1" (oldValue) is changed to "Layer2" (newValue), then I just traverse layer tree, check if oldValue/newValue matches my layer name, and&amp;nbsp;turn the oldValue layer off and the newValue&amp;nbsp;layer on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;No doubt there are more elegant ways to do this, and this is in no way configurable.&amp;nbsp;But I'm so excited the&amp;nbsp;light bulb has gone off. haha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/widget-to-turn-on-off-layers-no-not-the-layerlist/m-p/764835#M1052</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-12T08:28:43Z</dc:date>
    </item>
  </channel>
</rss>

