AnsweredAssumed Answered

Example of how to communicate between widgets?

Question asked by stevel on Jan 21, 2015
Latest reply on Jul 8, 2015 by FloCAD

The help page at Communication between widgets—Web AppBuilder for ArcGIS | ArcGIS  is pretty sparse:

 

As the requirement of reading or sending data between widgets is common, the BaseWidget class supports this programming model.

In the constructor of the BaseWidget class, it subscribes the publishData, dataFetched, and noData events. Meanwhile, the BaseWidget class provides the publishData and fetchData methods.

If you want the widget to publish data, call the publishData method. If you want the widget to receive data from another widget, call the fetchData method, and write code to override the onReceiveData and onNoData methods to read data.

Are there any examples showing how to pass information from one widget to another? Is there an example of how to use publishData and fetchData?

The post at Web Appbuilder Communication Between Widgets  hints at it, but doesn't show enough code for me to get it working.

Thanks

Outcomes