Class actuate.Dashboard
Description
Represents a dashboard object.
Constructor
Syntax
Constructs a dashboard object.
Parameters
Optional String. Container object or name of a container in the current document ID of container where controls are to be rendered.
Function summary
Table 4-5 describes actuate.Dashboard functions
Table 4-5 actuate.Dashboard function The personal Dashboard uses an embedded template file. Returns the dashboard name used by the Dashboard object. Unloads JavaScript variables that are no longer needed by Dashboard. save( ) Sets the container for rendering the Dashboard page HTML fragment. setSize( ) submit( ) Forces the Dashboard framework to use a personal dashboard.actuate.Dashboard.downloadDashboard
Syntax
Downloads the dashboard definitions.
Parameters
Function. The callback function to use after the Dashboard finishes downloading. This function must take the returned Dashboard object as an input parameter.
Example
This example specifies a function to call after the Dashboard object finishes downloading.
actuate.Dashboard.embedTemplate
Syntax
A personal dashboard can use a shared template file or embed a template file.
Parameters
Boolean. When the isEmbedded parameter is true, the personal dashboard uses an embedded template file. The default value is false.
Example
This example specifies that the personal dashboard myDashboard uses an embedded template file.
actuate.Dashboard.getActiveTab
Syntax
This function returns the name of the current active tab for the Dashboard.
Returns
String. The name of the current active Dashboard tab.
Example
This example calls getActiveTab( ) to display the name of the active tab for the myDashboard dashboard object in an alert box.
actuate.Dashboard.getDashboardName
Syntax
Returns the dashboard name used by the Dashboard object
Returns
Example
This example calls getDashboardName( ) to display the Dashboard object’s dashboard name in an alert box.
actuate.Dashboard.getTemplate
Syntax
Returns the repository path for the iServer volume.
Returns
String. The repository path for the iServer volume.
Example
This example calls getTemplate( ) to display the repository path for the iServer volume in an alert box.
actuate.Dashboard.onUnload
Syntax
Unloads JavaScript variables that are no longer needed by Dashboard.
Example
This example calls unloads JavaScript variables and displays the Dashboard object’s dashboard name in an alert box.
alert("JS variables unloaded for " + myDashboard.getDashboardName( ));actuate.Dashboard.registerEventHandler
Syntax
Registers an event handler to activate for parameter eventName. This function can assign several handlers to a single event.
Parameters
String. Event name to capture.
Function. The function to execute when the event occurs. The handler must take two arguments: the dashboard instance that fired the event and an event object specific to the event type.
Example
This example registers the errorHandler( ) function to respond to the ON_EXCEPTION event.
myDashboard.registerEventHandler(actuate.dashboard.EventConstants.ON_EXCEPTION, errorHandler);actuate.Dashboard.removeEventHandler
Syntax
Removes an event handler to activate for parameter eventName.
Parameters
String. Event name to remove from the internal list of registered events.
Function. The function to disable.
Example
This example removes the errorHandler( ) function from responding to the ON_EXCEPTION event.
myDashboard.removeEventHandler(actuate.dashboard.EventConstants.ON_EXCEPTION, errorHandler);actuate.Dashboard.renderContent
Syntax
Renders the dashboard definitions content to the container. The submit API calls the renderContent API internally. The renderContent( ) function assumes that the user has already a list of DashboardDefinition to process.
Parameters
Array of Objects. Each object is some piece of dashboard metadata and as many can be added as needed. Typically, this array contains the following metadata:
n dependency information between gadgets to support publishing and subscribing mechanismFunction. The callback function to call after renderContent( ) finishes.
Example
This example renders the myDash dashboard object using the defs dashboardDefinition array. and calls afterRender( ) once complete.
actuate.Dashboard.save
Syntax
Saves the dashboard as a .dashboard file.
Parameters
Function. Optional. The function to execute after the save operation completes.
Example
This example saves the dashboard as .dashboard file.
myDash.save( );actuate.Dashboard.setActiveTab
Syntax
Sets a specified tab as the active tab. Only one tab can be active at a time.
Parameters
String. The name of the tab to set as the active tab.
Example
This example sets the Files tab as the active tab for this dashboard.
actuate.Dashboard.setContainer
Syntax
The container that will be used for rendering the Dashboard page HTML fragment.
Parameters
Example
This example sets the container where the myDash dashboard object renders.
actuate.Dashboard.setDashboardName
Syntax
Sets the dashboard name to view.
Parameters
String. A fully qualified repository path and file name.
Example
This example sets the path for the myDash dashboard object.
actuate.Dashboard.setHeight
Syntax
Sets the dashboard’s startup height.
Parameters
Integer. Specifies the height in pixels.
Example
To set the dashboard height to 400 pixels, use code similar to the following:
actuate.Dashboard.setService
Syntax
Set the web service this dashboard component connects to.
Parameters
String. The URL of the web service to connect to.
actuate.RequestOptions object. Request options, if any, to apply to the connection. See actuate.RequestOptions for details on the options that this parameter can set.
Example
This example connects a dashboard component to the iPortal service and adds a custom URL parameter.
myDashboard.setService("http://localhost:8700/iportal", myRequestOptions.setCustomParameters({myParam: "myValue"});actuate.Dashboard.setSize
Syntax
Sets the dashboard’s startup size.
Parameters
Example
To set the dashboard height to 400 pixels and the width to 800 pixels, use code similar to the following:
actuate.Dashboard.setTemplate
Syntax
Sets the template path. This function overwrites the template path that is used by Information Console.
Parameters
String. Specifies a new template path.
Example
This example sets the template path for myDashboard to /iportal/jsapi/template/path.
actuate.Dashboard.setWidth
Syntax
Sets the dashboard’s startup width.
Parameters
Integer. Specifies the width in pixels.
Example
To set the dashboard width to 800 pixels, use code similar to the following:
actuate.Dashboard.showGallery
Syntax
Parameters
Boolean. The gadget gallery is visible when this parameter is set to true.
Example
To show the gadget gallery for the myDashboard dashboard object, use code similar to the following:
actuate.Dashboard.showTabNavigation
Syntax
Parameters
Boolean. The tab toolbar is visible when this parameter is set to true.
Example
To show the tab toolbar for the myDashboard dashboard object, use code similar to the following:
actuate.Dashboard.submit
Syntax
Submits requests to the server for the dashboard. When this function is called, an AJAX request is triggered to submit all pending operations. When the server finishes the processing, it returns a response and the results are rendered on the page in the dashboard container.
Parameters
Function. The function to execute after the asynchronous call processing is done.
Example
This example submits the dashboard name that was set with setDashboardName( ).
dash.submit( );actuate.Dashboard.usePersonalDashboard
Syntax
Forces the dashboard framework to use the user’s personal dashboard.
Parameters
Boolean. A value of true sets the dashboard framework to ignore any value set by the setDashboardName( ) method. The dashboard framework creates a new personal dashboard file for the logged in user when no personal dashboard file is present.
Example
To force the use of a personal dashboard for the myDashboard object, use code similar to the following:
(c) Copyright Actuate Corporation 2011 |
![]() |