Thank you @RobertScheitlin__GISP
I have been using the Widgets inside the \WebAppBuilderForArcGIS\client\stemapp\widgets\samplewidgets\WidgetCommunication folder as a starting point. I am planning to add the code from the 'widget.js' file in the WidgetA (Sending Message Widget) into another copy of the GroupFilter Widget. Below is the code that I had in mind for when the GroupFilter widget sends the currently entered filter user parameters to the second widget.
_onPublishClick: function() {
this.publishData({
message: 'I am widget Test' + _spObj
});
this.i ++;
this.pubInfoNode.innerText = 'Publish ' + this.i;
},
For the receiving widget, I plan to grab each user filter parameter from the group filter widget and display its value on the receiving widget, I was thinking of code similar to this in onReceiveData below.
onReceiveData: function(name, widgetId, data, historyData) {
//filter out messages
if(name !== 'GroupFilterTest'){
return;
}
var msg = '<div style="margin:10px;">' +
'<b>Groups Selected</b>:' + _spObj[0] + //grabs user parameter(s) from first filter criteria (Groups Selected)
'<br><b>Driver Selected:</b>' + _spObj[1] + //grabs user parameter(s) from second filter criteria (driver(s) selected)
'<br><b>Date Range Selected:</b>' + _spObj[2]; //grabs user parameter(s) from thurd filter criteria (date range selected)
//handle history data
if(historyData === true){
//want to fetch history data.
msg += '<br><b>historyData:</b>' + historyData + '. Fetch again.</div>';
this.messageNode.innerHTML = this.messageNode.innerHTML + msg;
this.fetchDataByName('WidgetA');
}else{
msg += '<br><b>historyData:</b><br>' +
array.map(historyData, function(data, i){
return i + ':' + data.message;
}).join('<br>') + '</div>';
this.messageNode.innerHTML = this.messageNode.innerHTML + msg;
What do you think? Am I approaching grabbing the values from the group filter widget incorrectly. Let me know if I can provide any further clarification.