Interaction in Dashboard Widgets using Eventing Suport
DubeyAnuj 270002GP5C Visits (2602)
Widgets interact with each other using events which is enabled through a publication and subscription mechanism in the dashboard.. To achieve interaction, an event information is passed using a publication and subscription model. A widget is capable to publish (or broadcast) certain events that other interested widgets can subscribe to, and widgets that can subscribe to a particular event knows how to react to it. A widget can both publish and subscribe to events supported by it at the same time.This blog covers the details of all the events supported ,and how to enable and disable them for a widget.
Settings related to publishing an event OR subscribing to an event can be configured by going to the "Events" Section of edit menu for any dashboarding widget.
This opens up a view to set eventing related preferences:
Note that based on the capabilities of a widget, event section of widget may provide different options related to eventing mechanism. For Example, browser reload widget will not provide any option in Published Events/Subscribed Events section , whereas refresh timer widget will provide only data refresh event option in the Published events section. Similarly Charting related widgets like Line Chart, Pie Chart, Column Chart will provide an additional option for TimeSet event in the subscribed events section.
In the published events section, checking on NodeClickedOn enables the widget to publish events on every click action on any node. A NodeClickedOn event sends an event based on the condition associated with the node clicked. This event is received by all the widgets subscribed to NodeClickedOn events. Subscription to NodeClickedOn events is achieved by checking on NodeClickedOn in the subscribed event section . Similarly a widget can be made to subscribe to other events like dataRefresh, TimeSet etc by checking on the respective events in the subscribed events section. However a subscribed widget may or may not respond to the NodeClickedOn event based on the conditions sent in the NodeClickedOn event. It means that target widget will take input from the parameters sent in NodeClickedOn event and based on inputs if the condition is not met in dataset of target widget, it may ignore event and will not respond.
An important point to note here that disabling a wire overrides any broadcast event settings and prevents communication between two widgets on the wire. An enabled wire takes precedence over broadcast event settings.