Detect when creation of first polygon (with attribute table) is finished by EditorViewModel in "creating-features" state

121
1
Jump to solution
02-06-2025 08:28 AM
Labels (2)
MichaelLev
Frequent Contributor

In 3D WAB app I am creating by WAB Developer Edition version 2.30 (jsApi 4.30),

I created custom widget containing ESRI Editor widget (and its EditorViewModel).

I need to detect when creating a single feature (including setting its attributes table) has been finished.

I can't programmatically command the EditorViewModel to create a single feature (disable batch creation) since for this I need the method startCreateFeaturesWorkflowAtFeatureEdit but it needs to get the feature as parameter whilst I want to create a new feature.

So, I programatically start batch creation by startCreateFeaturesWorkflowAtFeatureCreation giving it the layer, and I need to detect when creation of the first feature in the batch (and setting its attributes table) has been finished.

0 Kudos
1 Solution

Accepted Solutions
MichaelLev
Frequent Contributor

I succeeded by this link in ESRI blog https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/application-with-editor-widget-an... 

my code:

await reactiveUtils.when(
       () => editor.viewModel.featureFormViewModel,
       () => {
           editor.viewModel.featureFormViewModel.on("submit", function (event) {
           if (/* activity === create*/) {
           console.log(`** create finished`);
          /* jump to next activity */
      }
});

View solution in original post

0 Kudos
1 Reply
MichaelLev
Frequent Contributor

I succeeded by this link in ESRI blog https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/application-with-editor-widget-an... 

my code:

await reactiveUtils.when(
       () => editor.viewModel.featureFormViewModel,
       () => {
           editor.viewModel.featureFormViewModel.on("submit", function (event) {
           if (/* activity === create*/) {
           console.log(`** create finished`);
          /* jump to next activity */
      }
});

0 Kudos