<?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: Enable only individual feature creation on Editor widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1365519#M83238</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/14521"&gt;@LefterisKoumis&lt;/a&gt;&amp;nbsp;! Thanks for the tag &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm having trouble with your solution. Below is my interpretation of what you posted. I feel like something is missing before line 5, like that needs wrapped in an .on() call or something. I'm also primarily testing this against Point features, so I'm not sure if a Polyline/Polygon would make a difference here or not.&lt;/P&gt;&lt;P&gt;I also commented out line 5 (and it's ending bracket) to see what that would do. The `update` responds, and so does the `hitTest`, but it doesn't like `event.stopPropagation()` (I also tried `response.stopPropagation()` to be safe; no luck there either).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const editor = new Editor({ /* ...snip... */});
const editorVM = editor.viewModel;
let creationAvailable = true;

if (editorVM.state === 'creating-features' &amp;amp;&amp;amp; editorVM.featureFormViewModel.feature &amp;amp;&amp;amp; editorVM.featureFormViewModel.state === 'ready') {
    editorVM.sketchViewModel.on('update', (event) =&amp;gt; {
        if (editorVM.featureFormViewModel.state === 'ready' &amp;amp;&amp;amp; editorVM.sketchViewModel.activeTool === 'transform') {
            creationAvailable = false;
        }

        view.hitTest(event).then((response) =&amp;gt; {
            if ( ! creationAvailable) {
                if (editorVM.sketchViewModel.activeTool !== 'reshape') {
                    editorVM.sketchViewModel.cancel();
                    event.stopPropagation();
                    return;
                }
            }
        });
    });
}

editorVM.featureFormViewModel.on('submit', () =&amp;gt; (creationAvailable = true));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jan 2024 19:12:48 GMT</pubDate>
    <dc:creator>NicholasWright</dc:creator>
    <dc:date>2024-01-02T19:12:48Z</dc:date>
    <item>
      <title>Enable only individual feature creation on Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1361183#M83130</link>
      <description>&lt;P&gt;I'd like the users of the editor widget to create a feature, fill out the required fields and then submit it before they can create another feature. It seems by default, users can create multiple features before they can enter the field values which it can lead to lots of issues.&lt;/P&gt;&lt;P&gt;Apparently the desired workflow is the individual feature creation as described at this&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateFeaturesWorkflow.html" target="_self"&gt;link.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, on the same page it states that the type "create" is depreciated as of 4.23 and we should use the type "create-features" to create either individual or continuous features. But there is no mention of how to select the workflow to be individual or continuous.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a similar posts&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-amp-single-feature-creation/td-p/1311513" target="_self"&gt;link#1&lt;/A&gt;&amp;nbsp; &lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disabling-multiple-feature-creation/m-p/1191857" target="_self"&gt;link#2&lt;/A&gt;&amp;nbsp;&amp;nbsp; from&amp;nbsp; other users who experience the same issue.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/994"&gt;@HeatherGonzago&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115266"&gt;@AnneFitz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 00:26:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1361183#M83130</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2023-12-20T00:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Enable only individual feature creation on Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1362915#M83172</link>
      <description>&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;&lt;/FONT&gt;. Until ESRI responds with a solution, I have this workaround. Please let me know if there are issues with this method. It was tested and it works as intended.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;U&gt;&lt;STRONG&gt;Workaround:&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;First create a global variable. I named it "creating" and set it to true.&lt;/P&gt;&lt;P&gt;Then, set the variable to false when the user completes the sketch of the new feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (editorVM.state == 'creating-features' &amp;amp;&amp;amp; editorVM.featureFormViewModel.feature &amp;amp;&amp;amp; editorVM.featureFormViewModel.state == 'ready') 
{ editorVM.sketchViewModel.on("update", function (event) {
    if (editorVM.featureFormViewModel.state == "ready" &amp;amp;&amp;amp; (editorVM.sketchViewModel.activeTool == "transform")) {
      creating = false}   
    }
_ _ _ _ _ _
_ _ _ _ _ _&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, prevent the creation of new features by disabling the click event. Allow only reshaping the feature prior submitting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.hitTest(event).then((response) =&amp;gt; {
   if (!creating) {
     if (!(editorVM.sketchViewModel.activeTool == "reshape")) {
         editorVM.sketchViewModel.cancel()
         event.stopPropagation
         return
     }
  }
_ _ _ _ _
_ _ _ _ _&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the user submit the form for the feature, you can change the "creating" variable to true so you can create more features if needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; editor.viewModel.featureFormViewModel.on('submit', _ =&amp;gt; {
                    creating = true
_ _ _ _ 
_ _ _ _ &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/460282"&gt;@JB19&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/619910"&gt;@NicholasWright&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 16:08:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1362915#M83172</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2023-12-28T16:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Enable only individual feature creation on Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1365519#M83238</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/14521"&gt;@LefterisKoumis&lt;/a&gt;&amp;nbsp;! Thanks for the tag &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm having trouble with your solution. Below is my interpretation of what you posted. I feel like something is missing before line 5, like that needs wrapped in an .on() call or something. I'm also primarily testing this against Point features, so I'm not sure if a Polyline/Polygon would make a difference here or not.&lt;/P&gt;&lt;P&gt;I also commented out line 5 (and it's ending bracket) to see what that would do. The `update` responds, and so does the `hitTest`, but it doesn't like `event.stopPropagation()` (I also tried `response.stopPropagation()` to be safe; no luck there either).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const editor = new Editor({ /* ...snip... */});
const editorVM = editor.viewModel;
let creationAvailable = true;

if (editorVM.state === 'creating-features' &amp;amp;&amp;amp; editorVM.featureFormViewModel.feature &amp;amp;&amp;amp; editorVM.featureFormViewModel.state === 'ready') {
    editorVM.sketchViewModel.on('update', (event) =&amp;gt; {
        if (editorVM.featureFormViewModel.state === 'ready' &amp;amp;&amp;amp; editorVM.sketchViewModel.activeTool === 'transform') {
            creationAvailable = false;
        }

        view.hitTest(event).then((response) =&amp;gt; {
            if ( ! creationAvailable) {
                if (editorVM.sketchViewModel.activeTool !== 'reshape') {
                    editorVM.sketchViewModel.cancel();
                    event.stopPropagation();
                    return;
                }
            }
        });
    });
}

editorVM.featureFormViewModel.on('submit', () =&amp;gt; (creationAvailable = true));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 19:12:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1365519#M83238</guid>
      <dc:creator>NicholasWright</dc:creator>
      <dc:date>2024-01-02T19:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Enable only individual feature creation on Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1365579#M83240</link>
      <description>&lt;P&gt;Hello Nicholas.&lt;/P&gt;&lt;P&gt;Sorry I forgot to include in the posting before line#5&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;editorVM.watch(['state', 'featureFormViewModel.feature'], () =&amp;gt; {&lt;/LI-CODE&gt;&lt;P&gt;Also, for he hittest don't forget to include the return.&lt;/P&gt;&lt;P&gt;I attached a short video that shows that after you create the feature it let you only edit the geometry of the feature you created and it won't let you another feature unless if you complete the fields.&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6344176494112w860h540r972" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6344176494112" 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-6344176494112w860h540r972');  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/6344176494112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 20:55:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1365579#M83240</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2024-01-02T20:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Enable only individual feature creation on Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1365729#M83248</link>
      <description>&lt;P&gt;No dice &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&amp;nbsp; I made a barebones codepen for it though, maybe something will jump out to you.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/Tickthokk/pen/rNROPvy" target="_blank"&gt;https://codepen.io/Tickthokk/pen/rNROPvy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 13:19:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1365729#M83248</guid>
      <dc:creator>NicholasWright</dc:creator>
      <dc:date>2024-01-03T13:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Enable only individual feature creation on Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1366037#M83251</link>
      <description>&lt;P&gt;ok. I had to change it a little bit. Since you are using points you don't have to worry about altering the geometry of the features like I showed on the video clip. The purpose of the return in the hittest is in case that you have more actions in the event.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/lkoumis1/pen/bGZEwxK" target="_self"&gt;https://codepen.io/lkoumis1/pen/bGZEwxK&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 21:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1366037#M83251</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2024-01-03T21:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Enable only individual feature creation on Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1366399#M83258</link>
      <description>&lt;P&gt;Amazing&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt; Confirmed that this works. Thanks a million!&lt;/P&gt;&lt;P&gt;Tagging&amp;nbsp;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/460282" target="_blank"&gt;@JB19&lt;/A&gt;&amp;nbsp;for visibility&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 18:07:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-only-individual-feature-creation-on-editor/m-p/1366399#M83258</guid>
      <dc:creator>NicholasWright</dc:creator>
      <dc:date>2024-01-04T18:07:35Z</dc:date>
    </item>
  </channel>
</rss>

