Select to view content in your preferred language

Load selected data onOpen of smartEditor widget

956
3
07-22-2022 09:56 AM
BrianDiunizio_GISP
New Contributor II

Hello! I am developing a custom widget that allows a user to select from existing polygon boundaries, add the selection to an on-premise dataset, and fill out the attribute fields of the newly created boundary. I am leveraging the smartEditor widget to accomplish the step where users fill out attribute fields related to their work boundary. Another geographer has suggested that the step to click the desired treatment boundary after it has been added to the dataset and after the smartEditor widget opens is confusing. Rather, it was suggested to open the smartEditor widget with this selected boundary pre-determined already so as to advance to the attribute field population step immediately once the widget opens. I am leveraging WAB v2.19 and the smartEditor widget that is included with this install. I can clearly see the function involved once a click event occurs on the selected boundary (_processRelationAndShowAttrInspector in Widget.js), but this function accepts a DOM click event (evt) to fire the function. Does anyone have a suggestion on how to pass in my loaded feature and geometry to the smartEditor widget onOpen? As it stands now, I'm just opening the widget  with this.open("SmartEditor");. Is this even possible without a complete re-write? Is there an updated version that handles this?

Any help is certainly appreciated! I am relatively new to javascript 3.x and tend to revert back to my understanding of Python programming, which is very different! (@AlixVezina I think you wrote smartEditor and @RobertScheitlin__GISP I can tell you are fluent in javascript)

 

 

 

DiunizioBrian_0-1658508016577.jpeg

Tags (1)
0 Kudos
3 Replies
AlixVezina
Esri Regular Contributor

Hi @BrianDiunizio_GISP ,

Please would you be able to clarify all the steps your users are currently doing 1, 2 ,3... ? And also please the steps you would like to provide instead? Some screenshots may be helpful too.

Thank you!

0 Kudos
BrianDiunizio_GISP
New Contributor II

Thank you for your reply! 

  1. Users are uploading a shapefile as a graphic (referencing the Add Shapefile example)
  2. On the 'Add' button click, users can save the uploaded graphic to an on-prem prod dataset
  3. A lot of javascript is going on at this stage including an areal calc and performing a definition expression based on the uploaded polygon's objectid. I am using this def expression to select the polygon and simultaneously open smartEditor.
  4. Attribute fields are inspected and edited within smartEditor AFTER users click on the uploaded boundary.
  5. Is it possible to eliminate the polygon click in smartEditor and advance from capture3 to capture5 (see attached photos).

 

 

0 Kudos
AlixVezina
Esri Regular Contributor

Hi @BrianDiunizio_GISP thank you for the details!

We looked into this and, right now, the widget to widget communications on the Smart Editor's end only listens for selection messages from the Select widget and the Attribute Table widget (this was implemented starting with the Web AppBuilder developer edition 2.20 (see: ENH: Streaming the selection of features to update).

So one thing you could do, is load your selections in either the Select or the Attribute widgets, the Smart Editor should pick them up when it loads.

Otherwise, you could also look into setting up a feature action in your custom widget, and on execute, start up Smart Editor and execute programmatically instead of needing a click. Create a feature action in your widget—ArcGIS Web AppBuilder | ArcGIS Developers

 

 

0 Kudos