Class actuate.Parameter
Description
The actuate.Parameter class retrieves and displays Actuate BIRT report parameters in an HTML container. Users can interact with the parameters on the page and changes to the parameter values are passed to an actuate.Viewer object, not to the Server directly.
The actuate.Parameter class displays the parameters by page. The actuate.parameters.navigate( ) function changes the page display or changes the current position on the page.
Constructor
Syntax
Constructs a Parameter object for a page, initializing the parameter component.
Parameters
String. The name of the HTML element that displays the rendered parameter component or a container object. The constructor initializes the parameter component but does not render it.
Function summary
Table 4-17 lists actuate.Parameter functions.
Table 4-17 actuate.Parameter functions Returns the names of the groups of parameters. Render the Parameter content to the container. setFont( ) submit( ) Submits all the asynchronous operations that the user has requested on this parameter object and renders the parameters component on the page.actuate.Parameter.downloadParameterValues
Syntax
Returns an array of the actuate.parameter.ParameterValue objects for the Parameter object. If no values have been set, the parameter object downloads the default values from the server.
Parameters
Function. The function to execute after the report parameters finish downloading. Parameter.downloadParameterValues( ) sends an array of actuate.parameter.ParameterValue objects to the callback function as an input argument.
Example
To download the parameter values and add them to the viewer, the callback function must use the values as an input parameter, as shown in the following code:
actuate.Parameter.getLayout
Syntax
Returns the parameter layout type.
Returns
String. The parameter layout, which will match one of the layout constants in actuate.parameter.Constants:
Example
This example calls getLayout( ) to display the parameter layout type in an alert box.
actuate.Parameter.getParameterGroupNames
Syntax
Returns all the group names for the parameter page as an array of strings.
Returns
Array of strings. Each string is a group name.
Example
This example displays an alert box with the name of the first group for the parameter page:
actuate.Parameter.getReportName
Syntax
Returns the name of the report file currently referenced by this Parameter object.
Returns
Example
This example displays an alert box with the name of the report file:
actuate.Parameter.getTransientDocumentName
Syntax
Returns the name of the transient document generated by running the report currently referenced by this Parameter object.
Returns
Example
This example displays an alert box with the name of the transient document:
alert("Transient document: " + paramObj.getTransientDocumentName( ));actuate.Parameter.hideNavBar
Syntax
Hides the navigation bar for the parameter component in the LAYOUT_GROUP layout.
Example
This example hides the navigation bar:
actuate.Parameter.hideParameterGroup
Syntax
Hide all report parameters that belongs to a group or to a list of groups.
Parameters
String or Array of strings. Hides any groups listed.
Example
This example hides the report parameters that belong to the groups that are listed in the myGroups string array:
actuate.Parameter.hideParameterName
Syntax
Hide report parameters as specified by name.
Parameters
Example
This example hides the parameters that are listed in the myParams string array:
actuate.Parameter.navigate
Syntax
Changes the current page of the parameter component. The navTarget determines the new location to display the parameter container.
Parameters
String. The value of the id parameter for the HTML <div> element that holds the parameters component.
String constant. Which navigation button to trigger. Possible values from actuate.parameter.Constants are NAV_FIRST, NAV_PREV, NAV_NEXT, NAV_LAST.
Example
This example displays the last page of the parameters component in the HTML <div> element with the myParams ID.
actuate.Parameter.onUnload
Syntax
Performs garbage collection for the parameter object and unloads JavaScript variables that are no longer needed by Parameter.
Example
This example unloads JavaScript variables and displays an alert box.
actuate.Parameter.registerEventHandler
Syntax
Registers an event handler to activate for parameter events. This function can assign several handlers to a single event.
Parameters
actuate.parameter.EventConstants. A constant corresponding to a supported event. actuate.Parameter supports the following two events:Function. The function to execute when the event occurs. The handler must take two arguments: the parameter instance that fired the event and an event object specific to the event type.
Example
To register an event handler to catch exceptions, call actuate.Parameter.registerEventHandler using the ON_EXCEPTION constant after creating the viewer object, as shown in the following example:
actuate.Parameter.removeEventHandler
Syntax
void Parameter.removeEventHandler(actuate.viewer.EventConstants event, function handler)Parameters
actuate.parameter.EventConstants. A constant corresponding to a supported event. actuate.Parameter supports the following two events:
Function. A handler function registered for the event.
Example
To remove an event handler, call actuate.Parameter.removeEventHandler with a legal event constant, as shown in the following example:
actuate.Parameter.renderContent
Syntax
void Parameter.renderContent(actuate.parameter.ParameterDefinition[ ] paramDefs, function callback)Renders the parameter component to the container.
Parameters
Array of actuate.parameter.ParameterDefinition objects.
Function. The function to execute after the rendering is done.
Example
This example calls renderContent( ) after hiding parameter groups.
actuate.Parameter.setAutoSuggestDelay
Syntax
Sets the autosuggest delay time.
Parameters
Long. Interpreted as milliseconds.
Example
This example implements a custom autosuggest list. The list is 10 suggestions long and displays 3 suggestions at a time after a delay of 250 milliseconds.
actuate.Parameter.setAutoSuggestFetchSize
Syntax
Set the fetch size of the autosuggestion list. Autosuggest fetches all suggestions from the server when the fetch size is not set.
Parameters
Integer. The number of suggestions to fetch at a time.
Example
This example implements a custom autosuggest list. The list is 10 suggestions long and displays 3 suggestions at a time after a delay of 250 milliseconds.
actuate.Parameter.setAutoSuggestListSize
Syntax
Set the length of the autosuggestion list. Autosuggest shows all of the suggestions from the server when the list length is not set.
Parameters
Integer. The number of suggestions to display.
Example
This example implements a custom autosuggest list. The list is 10 suggestions long and displays 3 suggestions at a time after a delay of 250 milliseconds.
actuate.Parameter.setContainer
Syntax
Sets the HTML element container for the parameter content.
Parameters
String. The name of the HTML element that displays the group of rendered parameter components.
Example
This example sets the container where the parameter components render.
actuate.Parameter.setExpandedGroups
Syntax
Defines a set of groups that are expanded by default.
Parameters
Array of strings. The group names to expand by default.
Example
This example sets the "Motorcycles," "Trucks," and "Airplanes" groups as expanded by default.
actuate.Parameter.setFont
Syntax
Sets the font of the parameter page content after the page is rendered.
Parameters
Example
This example sets the font to arial for the parameters page.
actuate.Parameter.setGroupContainer
Syntax
Sets the HTML element container for the provided group. All parameter objects listed in groupNames are assigned to the container.
Parameters
Array of strings. The group names to be assigned.
String. The name of the HTML element that displays the group of rendered parameter components.
Example
This example assigns the group names in the myGroups string array to the leftpane HTML element.
actuate.Parameter.setLayout
Syntax
Parameters
String constant. Possible values are:
Example
This example sets the parameter object’s layout type to LAYOUT_COLLAPSIBLE.
actuate.Parameter.setReadOnly
Syntax
Sets the parameters to read-only.
Parameters
Boolean. True indicates that the parameters are read-only.
Example
This example makes the parameters read-only.
actuate.Parameter.setReportName
Syntax
Sets the report file from which to get report parameters.
Parameters
String. The report file path and name. The report file can be a report design file or a report document file.
Example
To set the name using an HTML input tag with an ID of Selector, use the following code:
actuate.Parameter.setService
Syntax
Sets the target service URL to which the parameter object links. If the service URL is not set, this parameter object links to the default service URL set on the actuate object.
Parameters
String. The target Actuate web application URL.
actuate.RequestOptions object. Optional. RequestOptions defines URL parameters to send with the authentication request, such as the iServer URL, Encyclopedia volume, or repository type. The URL can also include custom parameters.
Example
This example sets the URL for the Actuate iPortal web application service.
paramObj.setService("http://localhost:8700/iportal",myRequestOptions);actuate.Parameter.setShowDisplayType
Syntax
Sets whether localized data is shown or not.
Parameters
Boolean. True indicates that localized data is shown.
Example
This example hides localized data.
actuate.Parameter.submit
Syntax
Submits requests to the server for the report parameters. When this function is called, an AJAX request is triggered to submit all the operations. When the server finishes the processing, it returns a response and the results are rendered on the page in the parameter container.
Parameters
Function. The function to execute after the asynchronous call processing is done.
Example
This example calls submit( ) after hiding localized data.
(c) Copyright Actuate Corporation 2011 |
![]() |