<?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 Create feature using Editor widget, validate the input firstly then submit in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-feature-using-editor-widget-validate-the/m-p/1628897#M87309</link>
    <description>&lt;P&gt; &lt;/P&gt;&lt;P&gt;I'm using Editor widget for create features. Catch the "create" event and then validate wheter the feature is in the polygon or not. If it is not, set the invalid symbol and editor process pause.&amp;nbsp; If yes, then popup the attribute dialog.&lt;/P&gt;&lt;P&gt;The code not set invalid symbol sucessfull&lt;SPAN&gt;y and how to set the edit process to pause state?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Code snippet:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  view.when(() =&amp;gt; {

        const editor = new Editor({
          view: view
        });
        // Add widget to the view
        view.ui.add(editor, "top-right");
        // Add the boundary polygon  
        addGraphics();
        editor.viewModel.sketchViewModel.on("create", (evt) =&amp;gt; {
          const graphic = evt.graphic;
          // check if the graphic is in boundary polygon 
          contains = geometryEngine.contains(boundaryPolygon, graphic.geometry);
          if (!contains) {
            graphic.symbol = invalidSymbol;
            //set invalid symbol and pause edit

           //   editor.viewModel.sketchViewModel.update([graphic], { tool: "reshape" });
          }
        });
      });&lt;/LI-CODE&gt;&lt;P&gt;The complete code is as below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/Baohua-Chu/pen/qEdwzvb" target="_self"&gt;https://codepen.io/Baohua-Chu/pen/qEdwzvb&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/135570i2AF3DF617BC3A3EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="screenshot.png" alt="screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jul 2025 01:28:50 GMT</pubDate>
    <dc:creator>baohuachu7</dc:creator>
    <dc:date>2025-07-02T01:28:50Z</dc:date>
    <item>
      <title>Create feature using Editor widget, validate the input firstly then submit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-feature-using-editor-widget-validate-the/m-p/1628897#M87309</link>
      <description>&lt;P&gt; &lt;/P&gt;&lt;P&gt;I'm using Editor widget for create features. Catch the "create" event and then validate wheter the feature is in the polygon or not. If it is not, set the invalid symbol and editor process pause.&amp;nbsp; If yes, then popup the attribute dialog.&lt;/P&gt;&lt;P&gt;The code not set invalid symbol sucessfull&lt;SPAN&gt;y and how to set the edit process to pause state?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Code snippet:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  view.when(() =&amp;gt; {

        const editor = new Editor({
          view: view
        });
        // Add widget to the view
        view.ui.add(editor, "top-right");
        // Add the boundary polygon  
        addGraphics();
        editor.viewModel.sketchViewModel.on("create", (evt) =&amp;gt; {
          const graphic = evt.graphic;
          // check if the graphic is in boundary polygon 
          contains = geometryEngine.contains(boundaryPolygon, graphic.geometry);
          if (!contains) {
            graphic.symbol = invalidSymbol;
            //set invalid symbol and pause edit

           //   editor.viewModel.sketchViewModel.update([graphic], { tool: "reshape" });
          }
        });
      });&lt;/LI-CODE&gt;&lt;P&gt;The complete code is as below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/Baohua-Chu/pen/qEdwzvb" target="_self"&gt;https://codepen.io/Baohua-Chu/pen/qEdwzvb&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/135570i2AF3DF617BC3A3EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="screenshot.png" alt="screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 01:28:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-feature-using-editor-widget-validate-the/m-p/1628897#M87309</guid>
      <dc:creator>baohuachu7</dc:creator>
      <dc:date>2025-07-02T01:28:50Z</dc:date>
    </item>
  </channel>
</rss>

