Event Tips
The MultidimensionalTableInterface sends PropertyChange events when the value of a property changes. The following is a list of the property changed events that can be trapped:
application
cellTypes
columnAxis
commandsMask
computedvalues
coordinatorEnabled
database
dimensions
measures
metabase
ranges
rowAxis
selectedMeasures
selectedStatistics
statistics
subsets
totals
verifyEnabled
Adding PropertyChange Events
The following steps illustrate how to set up an event handler for any of these events:
- Create a project in webAF that contains a MultidimensionalTableView hooked up to a MultidimensionalTableV3Interface object as its model.
- In the customizer for the MultidimensionalTableV3Interface, specify a metabase, database, columnAxis and rowAxis.
- Select Handle Events... from its popup menu.
- In the dialog that displays, select "write your own code" for event handler.
- Add an Event handler for propertyChange event. In the event handler method, paste the following code:
if ((event.getPropertyName() != null) && (event.getPropertyName().equals("totals")))
System.out.println("Totals event received");
- Build and execute the project.
- Turn totals on. You will see "Totals event received" printed in the log.
- Add other event handlers for subsets, computed values, ranges, etc.
- Build and execute the project.
- Set subsets, add computed values, add a range, etc., and you will see "event received" printed in the log for each event.