This sample combines the Popup and Editor components so you can edit a selected feature directly from its popup. The popup’s actions slot contains a custom Edit feature Calcite action. Selecting it opens an Editor workflow for editing the feature’s attributes. When you apply your changes, the workflow closes and the popup refreshes to show the updated feature information. The Editor requires an editable feature layer; the service used in this sample supports attribute edits only.

The sample also uses a custom function to create two popup content elements: TextContent and AttachmentsContent. The text content changes color when a specific field value is updated, while the attachments content displays the feature’s attachments in a carousel.

Because the sample coordinates two separate components, it also handles when a user backs out of editing. It watches the Editor component’s state and, when the Editor returns to ready after the user selects the back button, removes the Editor and shows the popup again.

To try the sample, click a feature on the map to open its popup, then select the Edit feature action. Update the feature’s attributes and apply your changes to return to the popup with refreshed content. Select back to leave the workflow without applying edits.

2DUpdateWorkflowreactiveUtilsPopupTemplateactionsWorkflowAttachmentsviewOnReadyarcgis-editorarcgis-expandarcgis-maparcgis-popuparcgis-zoommap-componentscalcite-tilecalcite-actioncalcite-components5.2