<?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: layer.refresh() problem in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layer-refresh-problem/m-p/1030075#M14408</link>
    <description>&lt;P&gt;The solution is to clear the selection first before the refresh:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.selectionLayer.clearSelection();
this.selectionLayer.refresh();&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 24 Feb 2021 17:06:07 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2021-02-24T17:06:07Z</dc:date>
    <item>
      <title>layer.refresh() problem</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layer-refresh-problem/m-p/1029245#M14407</link>
      <description>&lt;P&gt;Edit: The weblayer in the webmap has a refresh interval =1 set and the webmap viewer does what I expect when it "refreshes". Hope that makes sense!&lt;/P&gt;&lt;P&gt;Part of a workflow is to update a value and then refresh the layer and my expectation is that the symbol would change to the unique value of the updated value.&lt;/P&gt;&lt;P&gt;I am setting a selectionLayer variable like so,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;array.map(_operLayers, lang.hitch(this, function (lyr) {
                    if (lyr.layerObject) {
                        if (lyr.visibility === true) {
                            this.selectionLayer = lyr.layerObject;
                        }
                    }
                }));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then attribute edits are applied and a refresh is called,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.selectionLayer.refresh();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While the layer seemingly "refreshes" or redraws, the symbology change I am expecting does not happen.&amp;nbsp; Curious if there's something simple I'm missing.&lt;/P&gt;&lt;P&gt;Consequently, if I refresh the entire WAB/page, of course the symbology draws to what I expect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Javascript 3.x&lt;/P&gt;&lt;P&gt;WABDev/Custom widget&lt;/P&gt;&lt;P&gt;The source to this WAB is a saved webmap with saved weblayer items.&amp;nbsp; So, my attempt/goal here is to configure items as much as possible rather that write a ton of Javascript in the UI.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 19:44:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layer-refresh-problem/m-p/1029245#M14407</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-02-22T19:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: layer.refresh() problem</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layer-refresh-problem/m-p/1030075#M14408</link>
      <description>&lt;P&gt;The solution is to clear the selection first before the refresh:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.selectionLayer.clearSelection();
this.selectionLayer.refresh();&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Feb 2021 17:06:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/layer-refresh-problem/m-p/1030075#M14408</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-02-24T17:06:07Z</dc:date>
    </item>
  </channel>
</rss>

