<?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: Editor Widget and Picking Up the Current Selection without another Map Click in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072426#M2202</link>
    <description>&lt;P&gt;In an app with editing widgets present, the popup itself has links to those widgets, which, if clicked, open the widget with the given feature already active.&lt;/P&gt;&lt;P&gt;Perhaps you can look at what's going on there and see if there's some code you can re-appropriate?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1624588077011.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/16946iB074F1725A0EC038/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1624588077011.png" alt="jcarlson_0-1624588077011.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 02:32:26 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-06-25T02:32:26Z</dc:date>
    <item>
      <title>Editor Widget and Picking Up the Current Selection without another Map Click</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072372#M2198</link>
      <description>&lt;P&gt;Hello!&amp;nbsp; Thanks for any ideas on this one.&amp;nbsp; The current Editing widget when opened always states "Select a feature to edit it" even if the bound map has a current selection.&amp;nbsp; The user has to click on the map again to select the same feature again before the editor displays the selected feature's attributes.&amp;nbsp; Does anyone know if this is a current limitation and if there is a workaround?&amp;nbsp; I have a custom version of this widget in the developer environment so can insert custom logic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 22:43:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072372#M2198</guid>
      <dc:creator>SBerg_VHB</dc:creator>
      <dc:date>2021-06-24T22:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget and Picking Up the Current Selection without another Map Click</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072426#M2202</link>
      <description>&lt;P&gt;In an app with editing widgets present, the popup itself has links to those widgets, which, if clicked, open the widget with the given feature already active.&lt;/P&gt;&lt;P&gt;Perhaps you can look at what's going on there and see if there's some code you can re-appropriate?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1624588077011.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/16946iB074F1725A0EC038/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1624588077011.png" alt="jcarlson_0-1624588077011.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 02:32:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072426#M2202</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-06-25T02:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget and Picking Up the Current Selection without another Map Click</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072750#M2216</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;for the suggestion.&amp;nbsp; If I can get the selected feature I'll try&amp;nbsp;&lt;SPAN&gt;startUpdateWorkflowAtFeatureSelection on the editor.&amp;nbsp; Not quite sure yet in the framework how to approach that or if it will work but I appreciate the idea.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 19:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072750#M2216</guid>
      <dc:creator>SBerg_VHB</dc:creator>
      <dc:date>2021-06-25T19:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget and Picking Up the Current Selection without another Map Click</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072822#M2217</link>
      <description>&lt;P&gt;Hi Sam,&lt;BR /&gt;&lt;BR /&gt;One approach is to use the popup's &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature" target="_blank" rel="noopener"&gt;selectedFeature&lt;/A&gt;&amp;nbsp;(a Graphic). We have an async function that (1) checks if there's a selected feature &amp;amp; (2) if a selected feature, handles the editing workflow, something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/** @jsx jsx */

// edit function
async editSelectedFeature() {

const jmv = this.state.jimuMapView;

if (jmv.view.popup.selectedFeature) {
this.state.currentWidget.startUpdateWorkflowAtFeatureEdit(jmv.view.popup.selectedFeature);
} else {
alert('Please first select a feature.');
}
}

// button in our html
&amp;lt;button onClick={async () =&amp;gt; { await this.editSelectedFeature() }}&amp;gt; Start Update Workflow&amp;lt;/button&amp;gt;&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;BR /&gt;Cheers,&lt;/P&gt;&lt;P&gt;Shawn&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 21:19:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072822#M2217</guid>
      <dc:creator>ShawnGoulet</dc:creator>
      <dc:date>2021-06-25T21:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget and Picking Up the Current Selection without another Map Click</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072861#M2218</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/172234"&gt;@ShawnGoulet&lt;/a&gt;,&amp;nbsp;thank you for the suggestion.&amp;nbsp; I gave it a shot but was unsuccessful.&amp;nbsp; Can you tell me if there is a way to get the selected map feature from a target layer in the map without a popup reference?&amp;nbsp; We are selecting the map feature from a related list click and this does not launch the popup - there is therefore no reference to a popup.selectedFeature when the editor is created on that page in any case until you click on the map again.&amp;nbsp; Ideally the Edit feature command would simply recognize the selected feature in the map or better yet when the widget is initialized the editor can be told to directly show the edit form for the feature.&amp;nbsp; Do you think this can be accomplished?&amp;nbsp; Thank you.&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="Sam_Berg_0-1624665065633.png" style="width: 615px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17065i9039C0DADFFC8823/image-dimensions/615x243?v=v2" width="615" height="243" role="button" title="Sam_Berg_0-1624665065633.png" alt="Sam_Berg_0-1624665065633.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sam_Berg_1-1624665316203.png" style="width: 612px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17066i125C990750CAE51F/image-dimensions/612x315?v=v2" width="612" height="315" role="button" title="Sam_Berg_1-1624665316203.png" alt="Sam_Berg_1-1624665316203.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Really appreciate the help.&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2021 00:04:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1072861#M2218</guid>
      <dc:creator>SBerg_VHB</dc:creator>
      <dc:date>2021-06-26T00:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget and Picking Up the Current Selection without another Map Click</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1074310#M2259</link>
      <description>&lt;P&gt;What I have working just now is a custom editor widget with both a&amp;nbsp;&lt;SPAN&gt;JimuMapViewComponent and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DataSourceComponent.&amp;nbsp; The editor widget is configured with the configured layer read in ActiveViewChanged, and that layer saved in state.&amp;nbsp; Then on DataRender I am getting the selection as suggested by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/476778"&gt;@AdrianAkbariNet4s&lt;/a&gt;&amp;nbsp;and &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/172234"&gt;@ShawnGoulet&lt;/a&gt;&amp;nbsp;and used to create a feature with the layer reference to pass to startUpdateWorkflowAtEdit.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;      if(this.state &amp;amp;&amp;amp; this.state.currentWidget  &amp;amp;&amp;amp; ds.getSelectedRecords().length==1){
        let g=new Graphic();
        g.attributes=ds.getSelectedRecords()[0].getData();
        g.layer=this.state.currentEditLayer;
        this.state.currentWidget.startUpdateWorkflowAtFeatureEdit(g);
      }&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;This seems to have the behavior I am looking for which keeping the editor in sync with feature selection changes.&amp;nbsp; Thanks alot.&amp;nbsp; Sam&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 17:40:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/editor-widget-and-picking-up-the-current-selection/m-p/1074310#M2259</guid>
      <dc:creator>SBerg_VHB</dc:creator>
      <dc:date>2021-06-30T17:40:28Z</dc:date>
    </item>
  </channel>
</rss>

