<?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: Popup clears definition expression on Feature Layer in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1582124#M17219</link>
    <description>&lt;P&gt;Thanks, I was pulling my code to bits assuming this was a react state issue.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Feb 2025 06:19:30 GMT</pubDate>
    <dc:creator>DavidWilton</dc:creator>
    <dc:date>2025-02-05T06:19:30Z</dc:date>
    <item>
      <title>Popup clears definition expression on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1337758#M8706</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm hoping that someone can tell me whether this is the expected behaviour in Experience Builder:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I have a map widget (widget1) that points at a webmap&lt;/LI&gt;&lt;LI&gt;I also have a second widget (widget2) that uses the MapViewManager to access the JimuMapView instance from widget1.&lt;/LI&gt;&lt;LI&gt;From that instance, it gets access to one of the webmap feature layers (JimuMapView.MapView.Map.Layers) and sets a definition expression on it&lt;/LI&gt;&lt;LI&gt;The feature layer is then filtered on the map according to the definition expression as expected.&lt;/LI&gt;&lt;LI&gt;However, when you click on the map and a popup displays, the definition expression is automatically cleared (I checked the definition expression value before and after displaying the popup) and the feature layer displays again all features, making setting the definition expression directly on the feature layer not viable in Experience Builder.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks in advance for your help&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 15:09:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1337758#M8706</guid>
      <dc:creator>DiegoDíazDoce</dc:creator>
      <dc:date>2023-10-13T15:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Popup clears definition expression on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1337774#M8707</link>
      <description>&lt;P&gt;Have you tried setting a filter in your webmap? If you want to hide something and never unhide it, it is a simple solution.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JeffreyThompson2_0-1697210610673.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/83051i619173AF302C8012/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JeffreyThompson2_0-1697210610673.png" alt="JeffreyThompson2_0-1697210610673.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;From your description, this sounds like an issue where React is triggering a re-rendering of some component that is removing your definition expression. There is probably a way to write a useEffect hook that watches your definition expression and re-adds it if it is removed, but it will be tricky to find the right way to do it without triggering an infinite loop.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 15:29:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1337774#M8707</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2023-10-13T15:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Popup clears definition expression on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1338510#M8758</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;JeffreyThompson&lt;/SPAN&gt;&lt;SPAN&gt;2,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your reply. Your suggestion of watching the definition expression and re-add if removed worked. Just had to include a condition to avoid triggering the infinite loop that you mentioned.&lt;/P&gt;&lt;P&gt;However, this is just a workaround, a hack to correct a faulty behaviour. In my opinion, a layer property shouldn't be overwritten by default functionality, like opening a pop-up.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 08:05:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1338510#M8758</guid>
      <dc:creator>DiegoDíazDoce</dc:creator>
      <dc:date>2023-10-17T08:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Popup clears definition expression on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1366021#M10075</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/485294" target="_self"&gt;&lt;SPAN class=""&gt;DiegoDíazDoce,&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I am suffering the same issue with setting the DefExpression (in my case on three featurelayers).&amp;nbsp; &amp;nbsp;I am having trouble coming up with a solution.&amp;nbsp; Would you mind sharing your code?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 21:18:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1366021#M10075</guid>
      <dc:creator>RobertBrundage</dc:creator>
      <dc:date>2024-01-03T21:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Popup clears definition expression on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1374894#M10529</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In case you are still looking for a solution/workaround, this snippet will watch changes in a layerView filter and will re-add the old value if the new value is null. It should work in the same way with layers and definitionExpressions.&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;reactiveUtils&lt;/SPAN&gt;.&lt;SPAN class=""&gt;watch&lt;/SPAN&gt;(&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;//&amp;nbsp;getValue&amp;nbsp;function&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;()&amp;nbsp;&lt;SPAN class=""&gt;=&amp;gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=""&gt;layerView&lt;/SPAN&gt;.&lt;SPAN class=""&gt;filter&lt;/SPAN&gt;?.&lt;SPAN class=""&gt;where&lt;/SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;//&amp;nbsp;Callback&amp;nbsp;function&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;(&lt;SPAN class=""&gt;newValue&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class=""&gt;oldValue&lt;/SPAN&gt;)&amp;nbsp;&lt;SPAN class=""&gt;=&amp;gt;&lt;/SPAN&gt;&amp;nbsp;{&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;console&lt;/SPAN&gt;.&lt;SPAN class=""&gt;log&lt;/SPAN&gt;(&lt;SPAN class=""&gt;'Old&amp;nbsp;value:&amp;nbsp;'&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class=""&gt;oldValue&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class=""&gt;'New&amp;nbsp;value:&amp;nbsp;'&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class=""&gt;newValue&lt;/SPAN&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;if&lt;/SPAN&gt;&amp;nbsp;(&lt;SPAN class=""&gt;!&lt;/SPAN&gt;&lt;SPAN class=""&gt;newValue&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=""&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=""&gt;oldValue&lt;/SPAN&gt;)&amp;nbsp;{&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;layerView&lt;/SPAN&gt;.&lt;SPAN class=""&gt;filter&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&amp;nbsp;{&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;where&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class=""&gt;oldValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;},&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;//&amp;nbsp;Optional&amp;nbsp;parameters&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;initial&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class=""&gt;true&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;);&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 16:55:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1374894#M10529</guid>
      <dc:creator>DiegoDíazDoce</dc:creator>
      <dc:date>2024-01-26T16:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Popup clears definition expression on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1545635#M15239</link>
      <description>&lt;P&gt;That's a life saver, thanks!&lt;/P&gt;&lt;P&gt;Still not entirely sure if the reset of definitionExpression on map interaction is intended behaviour, or if we are doing something wrong when it comes to component rerendering?&lt;/P&gt;&lt;P&gt;cc:&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/15282"&gt;@esriesri&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/85077"&gt;@esriesri3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 15:09:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1545635#M15239</guid>
      <dc:creator>Woodpecker1337</dc:creator>
      <dc:date>2024-10-04T15:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Popup clears definition expression on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1550954#M15561</link>
      <description>&lt;P&gt;I am also facing same problem when we Popup opened, Experience Builder application map clearing definition expression.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your support and help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 16:06:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1550954#M15561</guid>
      <dc:creator>GISFunctionalGroup</dc:creator>
      <dc:date>2024-10-22T16:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Popup clears definition expression on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1582124#M17219</link>
      <description>&lt;P&gt;Thanks, I was pulling my code to bits assuming this was a react state issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 06:19:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-clears-definition-expression-on-feature/m-p/1582124#M17219</guid>
      <dc:creator>DavidWilton</dc:creator>
      <dc:date>2025-02-05T06:19:30Z</dc:date>
    </item>
  </channel>
</rss>

