setActiveObject(objType: PP.Exp.Ui.EaxObjectType);
objType. The view to be activated.
The setActiveObject method activates workbook view.
To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). Process the ObjectStateChanged event, activate and refresh the Map view:
// Get tool panel for controlling visibility of presented workbook
var toolBarView = workbookBox.getDataView().getToolBarView();
// Process the ObjectStateChanged event
toolBarView.ObjectStateChanged.add(function (sender, eventArgs) {
// Output information about the map view state
var mapMeta = eventArgs.getMetadata().map;
console.log("Activity flag of the Map view: " + mapMeta.enabled);
console.log("Visibility flag of the Map view: " + mapMeta.visible);
});
// Make the Map view active
toolBarView.setActiveObject(PP.Exp.Ui.EaxObjectType.Map);
// Refresh the Map view
toolBarView.refresh(PP.Exp.Ui.EaxObjectType.Map)
After example execution the Map view is activated and refreshed:
![]()
Browser console shows event information:
Checkbox indicating that the Map view is active: True
Checkbox indicating that the Map view is visible: True
See also: