MashZone NextGen 10.2 | Appendix | Legacy Presto components | Mashables and Mashups | Views for Mashups and Mashables | Creating Pluggable Views or Libraries | Implement a Pluggable View Class | Pluggable View Classes: Triggering and Handling Events
 
Pluggable View Classes: Triggering and Handling Events
 
Register and Trigger View-Specific Events in Pluggable Views
Support DataTable Row Selection Events in Pluggable Views
Example: Complete D3 Pie with View-Specific and DataTable Events
Pluggable views may be used in basic apps with other views. Apps, in turn, may be used by themselves or included in workspace apps with other apps. Views may have events that occur to view elements which they must handle, but may also be of interest to other views or apps in different contexts. In turn, views may also be interested in events from other views or apps.
Note: This topic discusses specific aspects of how to implement pluggable view classes. For the basic implementation techniques, see Implement a Pluggable View Class.
To support inter-view communication, pluggable views can use their DataTable. The DataTable tracks row selection state for the results in the DataTable across all views that use that DataTable and also supports both firing and listening for row selection events.
Apps may also leverage view events and communication to provide inter-app communication through the MashZone NextGen App Framework. The MashZone NextGen App Framework supports publishing and subscribing to events (called topics) across apps.
Thus, pluggable views can choose to support two general categories of events:
*View-specific events typically based on common browser events such as click for elements in the view.
To enable view-specific events, you must Register and Trigger View-Specific Events in Pluggable Views.
*Row selection events for the view’s DataTable. See Support DataTable Row Selection Events in Pluggable Views for details.
Supporting DataTable events allows pluggable views to participate in row selection synchronization in basic apps. Virtually all MashZone NextGen built-in views participate in this synchronization where row selection in one view is automatically reflected in all other views, as appropriate, within a basic app.
DataTable row selection events are also highly useful for users to wire interactions in workspaces because these events include the data of the entire row, not just those columns included in the view.
See Example: Complete D3 Pie with View-Specific and DataTable Events for the fully completed example of both types of events.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release