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:
myDashboard.downloadDashboard(runNext);
function runNext(dashobject){
mydashboard.getDashboardName(dashobject);
}
embedTemplate
Syntax
void Dashboard.embedTemplate(boolean isEmbedded)
A personal dashboard can use a shared template file or embed a template file.
Parameter
isEmbedded
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:
myDashboard.embedTemplate(true);
getActiveTab
Syntax
string Dashboard.getActiveTab
Returns the name of the current active tab for the dashboard.
Returns
String. The name of the current active dashboard tab.
Example
This example displays the name of the active tab for the myDashboard dashboard object in an alert box:
alert(myDashboard.getActiveTab( ));
getDashboardName
Syntax
string Dashboard.getDashboardName( )
Returns the dashboard name used by the dashboard object.
Returns
String. The dashboard’s name.
Example
This example displays the dashboard object’s dashboard name in an alert box:
alert(myDashboard.getDashboardName( ));
getTemplate
Syntax
string Dashboard.getTemplate( )
Returns the repository path for the iHub volume.
Returns
String. The repository path for the iHub volume.
Example
This example displays the repository path for the iHub volume in an alert box:
alert(myDashboard.getTemplate( ));
isAutoSaveEnabled
Syntax
boolean Dashboard.isAutoSaveEnabled( )
Returns whether the autosave feature is enabled.
Returns
Boolean. True indicates that autosave is enabled.
Example
This example informs the user of the status of the autosave feature:
if (dashboard.isAutoSavEnabled()){
alert("Autosave is enabled.");
}else{
alert("Autosave is disabled.");
}
isSavingNeeded
Syntax
boolean Dashboard.isSavingNeeded( )
Returns whether there are unsaved changes on the dashboard.
Returns
Boolean. True indicates that there are unsaved changes on the dashboard.
Example
This example informs the user of unsaved changed:
if (dashboard.isSavingNeeded()){
alert("The dashboard contains unsaved changes.");
}
isUsingPersonalDashboard
Syntax
boolean Dashboard.isUsingPersonalDashboard( )
Returns whether this dashboard is a personal dashboard.
Returns
Boolean. True indicates that this dashboard is a personal dashboard.
Example
This example informs the user that they are using a personal dashboard:
if (dashboard.isUsingPersonalDashboard)){
alert("This is a personal dashboard.");
}
onUnload
Syntax
void Dashboard.onUnload( )
Unloads JavaScript variables that are no longer needed by the dashboard.
Example
This example unloads JavaScript variables and displays the dashboard object’s dashboard name in an alert box:
myDashboard.onUnload;
alert("JS variables unloaded for " +
myDashboard.getDashboardName( ));
registerEventHandler
Syntax
void Dashboard.registerEventHandler(string eventName, function handler)
Registers an event handler to activate for parameter eventName. This function can assign several handlers to a single event.
Parameters
eventName
String. Event name to capture.
handler
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:
void Dashboard.renderContent(object[ ] dashboardDefinitions, function callback)
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
dashboardDefinitions
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:
Number of tabs in a dashboard file
Number of sections/columns in a dashboard tab
Number of gadgets in each section/column
Attributes of each gadget
Attributes of each tab
Dependency information between gadgets to support publishing and subscribing mechanism
callback
Function. The callback function to call after renderContent( ) finishes.
Example
This example renders the myDash dashboard object using the dashboardDefinition array defs and calls afterRender( ) once complete:
Saves the dashboard as a .dashboard file to a specific path.
Parameters
callback
Function. Optional. The function to execute after the save operation completes.
saveAsPath
String. Optional. Fully qualified path in which to save the dashboard. The default value is the path for the original dashboard file, if one exists, or the path for the user’s home directory.
replace
Boolean. Optional. True indicates to replace the latest version of the file. False indicates to create a new version.
flag
Boolean. Optional. True indicates a synchronous save operation.
Example
This example saves the dashboard as a .dashboard file, replacing the latest version:
myDash.saveAs(null, null, true, true);
setActiveTab
Syntax
void Dashboard.setActiveTab(string tabName)
Sets a specified tab as the active tab. Only one tab can be active at a time.
Parameter
tabName
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:
myDash.setActiveTab("Files");
setAutoSaveDelay
Syntax
void Dashboard.setAutoSaveDelay(integer seconds)
Sets the amount of time before executing an automatic save for a personal dashboard.
Parameter
seconds
Integer. The number of seconds to delay the automatic save.
Example
This example sets the delay for the automatic save for dashboard myDash to 5 minutes:
myDash.setAutoSaveDelay(300);
setContainer
Syntax
void Dashboard.setContainer(string containerID)
The container that will be used for rendering the dashboard page HTML fragment.
Parameter
containerID
String. The container ID.
Example
This example sets the container where the myDash dashboard object renders:
Sets the web service this dashboard component connects to.
Parameters
iportalURL
String. The URL of the web service to connect to.
requestOptions
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:
To set the dashboard width to 800 pixels, use code similar to the following:
myDashboard.setWidth(800);
showTabNavigation
Syntax
void Dashboard.showTabNavigation(boolean show)
Shows the tab toolbar.
Parameter
show
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:
myDashboard.showTabNavigation(true);
submit
Syntax
void Dashboard.submit(function callback)
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.
Parameter
callback
Function. The function to execute after the asynchronous call processing is done.
Example
This example submits the dashboard name that was set with setDashboardName( ):
Forces the dashboard framework to use the user’s personal dashboard.
Parameter
true|false
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: