<?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: Cannot trigger headerActions with the arcgis-features map component in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-trigger-headeractions-with-the-arcgis/m-p/1632227#M87363</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/477297"&gt;@FrValade1&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;Right now, the `trigger-action` event only covers the actions in the action bar. This doesn't include the header actions. We will look into updating the `trigger-action` event to fire when `headerActions` are triggered as well.&lt;/P&gt;&lt;P&gt;Could you provide more information on your use case for adding a custom headerAction? Looks like you may be creating a dock button for the Features component?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jul 2025 21:51:13 GMT</pubDate>
    <dc:creator>LaurenBoyd</dc:creator>
    <dc:date>2025-07-10T21:51:13Z</dc:date>
    <item>
      <title>Cannot trigger headerActions with the arcgis-features map component</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-trigger-headeractions-with-the-arcgis/m-p/1632001#M87357</link>
      <description>&lt;P&gt;I'm using the arcgis-features map component in a react application and I'm able to add an action button in the header. Now the problem is that the "&lt;SPAN&gt;onarcgisTriggerAction" event handler is never fired when I click on the action button. Is this a bug?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FrValade1_0-1752157413318.png" style="width: 200px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/136292i2DAAD8A7967F5903/image-size/small?v=v2&amp;amp;px=200" role="button" title="FrValade1_0-1752157413318.png" alt="FrValade1_0-1752157413318.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here's my code :&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; const [actionDetacherInformations] = useState(new Collection([new ActionButton({icon:"popup", title:"Détacher", id:"detacher",type:"button"})]));
&amp;lt;arcgis-features
    onarcgisTriggerAction={e =&amp;gt; {
            if(e.detail.action.id === "detacher"){
                   setPopupDockEnabled(false);
            }
    }}
    headerActions={actionDetacherInformations}
referenceElement={mapId}&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 14:29:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-trigger-headeractions-with-the-arcgis/m-p/1632001#M87357</guid>
      <dc:creator>FrValade1</dc:creator>
      <dc:date>2025-07-10T14:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot trigger headerActions with the arcgis-features map component</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-trigger-headeractions-with-the-arcgis/m-p/1632227#M87363</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/477297"&gt;@FrValade1&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;Right now, the `trigger-action` event only covers the actions in the action bar. This doesn't include the header actions. We will look into updating the `trigger-action` event to fire when `headerActions` are triggered as well.&lt;/P&gt;&lt;P&gt;Could you provide more information on your use case for adding a custom headerAction? Looks like you may be creating a dock button for the Features component?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 21:51:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-trigger-headeractions-with-the-arcgis/m-p/1632227#M87363</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2025-07-10T21:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot trigger headerActions with the arcgis-features map component</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-trigger-headeractions-with-the-arcgis/m-p/1632465#M87372</link>
      <description>&lt;P&gt;I wanted to add a dock button to the header and I &lt;SPAN&gt;thought&amp;nbsp;&lt;/SPAN&gt;that the &lt;SPAN&gt;`trigger-action` event would be triggered since the headerActions property was available in the component.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Also, I noticed that once I close the features component by using the default close button, I can't open or fetch features anymore because of an error :&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; const featuresHandle = reactiveUtils.on(
                () =&amp;gt; arcgisMapRef.current?.view,
                "click",
                async (event) =&amp;gt; {
                    if(popupDockEnabled){
                        const { screenPoint } = event;
                        const features = await featuresRef.current?.fetchFeatures(screenPoint);
                        const graphics = await features?.allGraphicsPromise;
                        setPopupAucunResultat(graphics?.length === 0);
                        if (featuresRef.current) {
                            featuresRef.current.features = graphics ?? [];
                        }
                        setPanneauSelectionne("information");
                        setPanneauGaucheFerme(false);
                    }
                }
            )&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FrValade1_0-1752247582380.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/136385i1E823000443A5D8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FrValade1_0-1752247582380.png" alt="FrValade1_0-1752247582380.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Finally, I resolved my problem by hiding the header with the hideHeading and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;hideCloseButton&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;properties and wrapping the arcgis-features component inside a calcite-flow-item with a header and custom actions. I replaced the close button with a custom action that&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;change the closed property on the component. By doing it this way, there was no more problems with the fetchFeatures promise.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;calcite-flow&amp;gt;
            &amp;lt;calcite-flow-item closed={!popupDockEnabled || popupAucunResultat} selected heading={titreFeatures ?? undefined}&amp;gt;
                &amp;lt;calcite-action text="Afficher dans la carte" title="Afficher dans la carte" slot="header-actions-end" icon="popup"
                    onClick={async () =&amp;gt; {
                        setPopupDockEnabled(false);
                        await arcgisMapRef.current?.view.openPopup({ features: featuresRef.current?.features })
                        if (arcgisMapRef.current?.view.popup) {
                            while (arcgisMapRef.current.view.popup.selectedFeatureIndex !== featuresRef.current?.selectedFeatureIndex) {
                                arcgisMapRef.current.view.popup.next();
                            }
                        }
                    }
                }&amp;gt; &amp;lt;/calcite-action&amp;gt;
                &amp;lt;calcite-action text="Fermer" title="Fermer" slot="header-actions-end" icon="x"
                    onClick={() =&amp;gt; {
                        setPopupAucunResultat(true);
                    }
                }&amp;gt; &amp;lt;/calcite-action&amp;gt;
                &amp;lt;arcgis-features ref={featuresRef}
                    onarcgisReady={() =&amp;gt; setFeaturesRefReady(true)}
                    hideHeading
                    hideCloseButton
                    closed={!popupDockEnabled || popupAucunResultat}
                    referenceElement={mapId}&amp;gt;
                &amp;lt;/arcgis-features&amp;gt;
            &amp;lt;/calcite-flow-item&amp;gt;
        &amp;lt;/calcite-flow&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2025 15:34:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-trigger-headeractions-with-the-arcgis/m-p/1632465#M87372</guid>
      <dc:creator>FrValade1</dc:creator>
      <dc:date>2025-07-11T15:34:50Z</dc:date>
    </item>
  </channel>
</rss>

