<?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: Force LayerList widget to refresh in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/803801#M5521</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;&lt;/P&gt;&lt;P&gt;thanks for the help, I didn't know that I could directly call the refresh function.&lt;/P&gt;&lt;P&gt;I noticed that&amp;nbsp;I still have to add and remove the dummy layer for the refresh to take effect, but it's not a big deal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 May 2019 06:49:24 GMT</pubDate>
    <dc:creator>sitsit</dc:creator>
    <dc:date>2019-05-10T06:49:24Z</dc:date>
    <item>
      <title>Force LayerList widget to refresh</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/803799#M5519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to modify the Save Session widget to save changes made by the user in the order of the layers, but I am stuck.&lt;/P&gt;&lt;P&gt;I succeeded in reorder the layers in the map, but the LayerList still shows the previous order.&lt;/P&gt;&lt;P&gt;Is there a simple way to force the LayerList to refresh?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to add and then remove a dummy layer, with the following results:&lt;/P&gt;&lt;P&gt;- if the LayerList is not loaded when I load the session, everything works fine&lt;/P&gt;&lt;P&gt;- if the LayerList is already loaded when I load the session, the LayerList does not refresh&lt;/P&gt;&lt;P&gt;To add and remove the layer I simply used addLayer and removeLayer:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var dumLayer = new ArcGISDynamicMapServiceLayer(layer.url);
this.map.addLayer(dumLayer);
this.map.removeLayer(dumLayer);&lt;/PRE&gt;&lt;P&gt;Did I forget something? I also noticed that if I comment the removeLayer line, the LayerList does not refresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to destroy and recreeate the layer, but I don't undesrstand how to use the WidgetManager createWidget method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:56:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/803799#M5519</guid>
      <dc:creator>sitsit</dc:creator>
      <dc:date>2021-12-12T16:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Force LayerList widget to refresh</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/803800#M5520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Marco,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp; Sure get a reference to the LayerList widget and call its _refresh method.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 12:32:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/803800#M5520</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-05-09T12:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Force LayerList widget to refresh</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/803801#M5521</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;&lt;/P&gt;&lt;P&gt;thanks for the help, I didn't know that I could directly call the refresh function.&lt;/P&gt;&lt;P&gt;I noticed that&amp;nbsp;I still have to add and remove the dummy layer for the refresh to take effect, but it's not a big deal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2019 06:49:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/803801#M5521</guid>
      <dc:creator>sitsit</dc:creator>
      <dc:date>2019-05-10T06:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Force LayerList widget to refresh</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/1289064#M14889</link>
      <description>&lt;P&gt;How to refresh layerlist in 4.x?&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 09:24:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/1289064#M14889</guid>
      <dc:creator>imritanshu</dc:creator>
      <dc:date>2023-05-15T09:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Force LayerList widget to refresh</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/1289540#M14890</link>
      <description>&lt;P&gt;for someone who is looking for a solution in 4.x can use below function to recompile layerlist&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;this.layerListWidget.viewModel._recompileList();&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 16 May 2023 12:06:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/1289540#M14890</guid>
      <dc:creator>imritanshu</dc:creator>
      <dc:date>2023-05-16T12:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Force LayerList widget to refresh</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/1299074#M14912</link>
      <description>&lt;P&gt;Hi imritanshu&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks for this, Would you mind sharing how to implement this as a reset button within the layerlist if you have this worked out?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks for the help with this it's really appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Leon&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 10:38:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/force-layerlist-widget-to-refresh/m-p/1299074#M14912</guid>
      <dc:creator>LeonDavis</dc:creator>
      <dc:date>2023-06-14T10:38:19Z</dc:date>
    </item>
  </channel>
</rss>

