AnsweredAssumed Answered

How to pass resulting featureSet to Screening Widget with feature action?

Question asked by jawest1 on Oct 20, 2017
Latest reply on Jul 20, 2018 by jawest1

Currently I have the select widget set  up to open smart editor with a feature action. I created another action to open the screening widget, but can't get the feature/attributes of the selected feature passed to the screening widget automatically. Currently once the screening widget opens I have to select the feature again. How do I populate the screening widget with the selected features automatically within the feature action? I'm very new to WAB.

 

Here is the code for my feature action- 

 

   

define([
  'dojo/_base/declare',
  'dojo/_base/lang',
  '../BaseFeatureAction',
  'jimu/utils',
  'jimu/PanelManager',
  'jimu/WidgetManager',
  'dojo/Deferred',
  'dijit/registry'
], function(declare, lang, BaseFeatureAction, utils, PanelManager, WidgetManager, Deferred, registry){
  var clazz = declare(BaseFeatureAction, {
    name: 'PrintTicket',
    iconClass: 'icon-edit',

    isFeatureSupported: function(featureSet){
         
      return featureSet.features.length > 0;
 
    },

    onExecute: function(featureSet){
          WidgetManager.getInstance().triggerWidgetOpen('widgets_Screening_Widget_41')

           .then(function(myWidget) {

                var ticket = featureSet.features[0].attributes;
                console.log(ticket);

                var fName = [];
                fName[0] = featureSet.spatialReference.wkid;
                fName[1] = featureSet.displayFieldName;
                fName[2] = featureSet.geometryType;
                console.log('log: step 0 '+fName[1] +'  ' + fName[2]);
               
           });
          this.map._extentUtil({ numLevels: 10});
          utils.featureAction.zoomTo(this.map, featureSet.features);
         
    },
         
  });
  return clazz;
});

 

   

   The console will log all fields and my geometry etc. I'm not sure how to pass feature to Screening widget though.

Outcomes