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-
<SPAN class="token function">define</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>
<SPAN class="string token">'dojo/_base/declare'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'dojo/_base/lang'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'../BaseFeatureAction'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'jimu/utils'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'jimu/PanelManager'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'jimu/WidgetManager'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'dojo/Deferred'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'dijit/registry'</SPAN>
<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>declare<SPAN class="punctuation token">,</SPAN> lang<SPAN class="punctuation token">,</SPAN> BaseFeatureAction<SPAN class="punctuation token">,</SPAN> utils<SPAN class="punctuation token">,</SPAN> PanelManager<SPAN class="punctuation token">,</SPAN> WidgetManager<SPAN class="punctuation token">,</SPAN> Deferred<SPAN class="punctuation token">,</SPAN> registry<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> clazz <SPAN class="operator token">=</SPAN> <SPAN class="token function">declare</SPAN><SPAN class="punctuation token">(</SPAN>BaseFeatureAction<SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
name<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'PrintTicket'</SPAN><SPAN class="punctuation token">,</SPAN>
iconClass<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'icon-edit'</SPAN><SPAN class="punctuation token">,</SPAN>
isFeatureSupported<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>featureSet<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">return</SPAN> featureSet<SPAN class="punctuation token">.</SPAN>features<SPAN class="punctuation token">.</SPAN>length <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
onExecute<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>featureSet<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>
WidgetManager<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getInstance</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">triggerWidgetOpen</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'widgets_Screening_Widget_41'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">.</SPAN><SPAN class="token function">then</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>myWidget<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> ticket <SPAN class="operator token">=</SPAN> featureSet<SPAN class="punctuation token">.</SPAN>features<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">;</SPAN>
console<SPAN class="punctuation token">.</SPAN><SPAN class="token function">log</SPAN><SPAN class="punctuation token">(</SPAN>ticket<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> fName <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
fName<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> featureSet<SPAN class="punctuation token">.</SPAN>spatialReference<SPAN class="punctuation token">.</SPAN>wkid<SPAN class="punctuation token">;</SPAN>
fName<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> featureSet<SPAN class="punctuation token">.</SPAN>displayFieldName<SPAN class="punctuation token">;</SPAN>
fName<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> featureSet<SPAN class="punctuation token">.</SPAN>geometryType<SPAN class="punctuation token">;</SPAN>
console<SPAN class="punctuation token">.</SPAN><SPAN class="token function">log</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'log: step 0 '</SPAN><SPAN class="operator token">+</SPAN>fName<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">+</SPAN><SPAN class="string token">' '</SPAN> <SPAN class="operator token">+</SPAN> fName<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">_extentUtil</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN> numLevels<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">10</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
utils<SPAN class="punctuation token">.</SPAN>featureAction<SPAN class="punctuation token">.</SPAN><SPAN class="token function">zoomTo</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">,</SPAN> featureSet<SPAN class="punctuation token">.</SPAN>features<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">return</SPAN> clazz<SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
The console will log all fields and my geometry etc. I'm not sure how to pass feature to Screening widget though.