<?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 features widget not working? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1548107#M85875</link>
    <description>&lt;P&gt;For some feature layers,&amp;nbsp; when you click on a feature, you expect the popup to be displayed on the features widget panel, but it just opens and closes the widget immediately!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/lkoumis1/pen/poXqjxR" target="_self" rel="nofollow noopener noreferrer"&gt;https://codepen.io/lkoumis1/pen/poXqjxR&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's similar to the example posted here. The only difference is that I added a feature Layer instead of using a webmap.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-features" target="_self" rel="nofollow noopener noreferrer"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-features&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Oct 2024 16:27:16 GMT</pubDate>
    <dc:creator>LefterisKoumis</dc:creator>
    <dc:date>2024-10-11T16:27:16Z</dc:date>
    <item>
      <title>features widget not working?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1548107#M85875</link>
      <description>&lt;P&gt;For some feature layers,&amp;nbsp; when you click on a feature, you expect the popup to be displayed on the features widget panel, but it just opens and closes the widget immediately!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/lkoumis1/pen/poXqjxR" target="_self" rel="nofollow noopener noreferrer"&gt;https://codepen.io/lkoumis1/pen/poXqjxR&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's similar to the example posted here. The only difference is that I added a feature Layer instead of using a webmap.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-features" target="_self" rel="nofollow noopener noreferrer"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-features&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 16:27:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1548107#M85875</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2024-10-11T16:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: features widget not working?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1548128#M85876</link>
      <description>&lt;P&gt;The map layer that you're providing doesn't have a popupTemplate defined, whereas the web map does. Once you add a template (like in this &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/" target="_self"&gt;sample&lt;/A&gt;), the Features widget works as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        const template = {
          title: 'This is a test'
        }

        const featureLayer = new FeatureLayer({
          url: "https://gis.cnra.ca.gov/arcgis/rest/services/Boundaries/CCED_AccessType/MapServer/0",
           outFields:['*'],
           popupTemplate: template
        });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_f88fc6.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117114i0E578D6D5F8BBBD1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_f88fc6.png" alt="Snag_f88fc6.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 18:05:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1548128#M85876</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-11T18:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: features widget not working?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1548233#M85877</link>
      <description>&lt;P&gt;Thank you for the response&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;. Yes, your solution works for that layer. I used that layer in my example because it is visible on the public. However, my issue is with another layer that I cannot share.&lt;/P&gt;&lt;P&gt;I am sharing the code of how I define the template, and a brief video to show the issue.&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6363145655112w712h540r722" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6363145655112" data-account="6161463677001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6161463677001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6363145655112w712h540r722');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.esri.com/t5/video/gallerypage/video-id/6363145655112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;       const featureLayer = new FeatureLayer({
         url: "https://xyz/MapServer/0",
          outFields:['*'],
         
       });
        map.add(featureLayer);
        view.when(() =&amp;gt;{
          const popupTemplate = featureLayer.createPopupTemplate();
          featureLayer.popupTemplate = popupTemplate;
        })&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 17:47:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1548233#M85877</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2024-10-12T17:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: features widget not working?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1548669#M85891</link>
      <description>&lt;P&gt;I substituted another layer and the code would work sometimes, returning content in the Features widget, but it wasn't consistent. Sometimes it would throw the error "popupTemplate is null". Are you getting that in your console?&lt;/P&gt;&lt;P&gt;I changed the view.when to featureLayer.when and that seemed be more consistent with a layer that takes a while to load.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_486a93.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117228i857432320430A839/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_486a93.png" alt="Snag_486a93.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I also tried using an await function with the FeatureLayerView and that seemed pretty consistent also.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.when(() =&amp;gt;{
  (async () =&amp;gt; { 
    const layerView = await view.whenLayerView(featureLayer);
    await reactiveUtils.whenOnce(() =&amp;gt; !layerView.updating);
    const popupTemplate = featureLayer.createPopupTemplate();
    popupTemplate.title = 'This is a test'; 
    featureLayer.popupTemplate = popupTemplate;
  })()
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 14:36:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1548669#M85891</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-15T14:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: features widget not working?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1549132#M85904</link>
      <description>&lt;P&gt;Thank you Ken. After hours of working on this problem, found out that the issue was of how the REST service for this layer was published. After it was republished, the issue went away. However, you script assisted with faster loading of large datasets.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 16:52:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/features-widget-not-working/m-p/1549132#M85904</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2024-10-16T16:52:56Z</dc:date>
    </item>
  </channel>
</rss>

