Class actuate.Parameter
Description
The actuate.Parameter class retrieves and displays BIRT report parameters in an HTML container. Users can interact with the parameters on the page and pass parameter values to an actuate.Viewer object, but not to the web service directly.
The actuate.Parameter class displays the parameters by page. The actuate.Parameter.navigate( ) function changes the page display or changes the current position on the page.
Constructor
Syntax
actuate.Parameter(string container)
Constructs a parameter object for a page, initializing the parameter component.
Parameter
container
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 11‑4 lists actuate.Parameter functions.
Table 11‑4 actuate.Parameter functions
Function
Description
downloadParameterValues( )
Returns an array list of ParameterValue objects
getReportName( )
Returns the name of the report file
getTransientDocumentName( )
Returns the name of the transient document
navigate( )
Navigates the parameter page
onUnload( )
Unloads unused JavaScript variables
renderContent( )
Renders the parameter content to the container
setAutoSuggestDelay( )
Sets the autosuggest delay time
setAutoSuggestFetchSize( )
Sets the fetch size of the autosuggestion list
setAutoSuggestListSize( )
Sets the size of the autosuggestion list
setContainer( )
Sets the HTML container for the parameter content
setReportName( )
Sets the remote report path and name
setService( )
Sets the Actuate web application service
setShowDisplayType( )
Sets the parameter page to display localized content
submit( )
Submits all the asynchronous operations that the user has requested on this Parameter object and renders the parameter component on the page
actuate.Parameter.downloadParameterValues
Syntax
void Parameter.downloadParameterValues(function callback)
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.
Parameter
callback
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:
paramObj.downloadParameterValues(runNext);
function runNext(values){
viewer.setParameterValues(values);
}
actuate.Parameter.getReportName
Syntax
string Parameter.getReportName( )
Returns the name of the report file currently referenced by this Parameter object.
Returns
String. The report file name.
Example
This example displays an alert box with the name of the report file:
alert("Report file: " + paramObj.getReportName( ));
actuate.Parameter.getTransientDocumentName
Syntax
string Parameter.getTransientDocumentName( )
Returns the name of the transient document generated by running the report currently referenced by this Parameter object.
Returns
String.
Example
This example displays an alert box with the name of the transient document:
alert("Transient document: " + paramObj.getTransientDocumentName( ));
actuate.Parameter.navigate
Syntax
void Parameter.navigate(string containerId, string navTarget)
Changes the current page of the parameter component. The navTarget determines the new location to display the parameter container.
Parameters
containerId
String. The value of the id parameter for the HTML <div> element that holds the parameter component.
navTarget
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 parameter component in the HTML <div> element with the myParams ID:
function myParamsLast(myParameter){
myParameter.navigate("myParams", NAV_LAST);
}
actuate.Parameter.onUnload
Syntax
void Parameter.onUnload( )
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:
myParameter.onUnload();
alert("JS variables unloaded.");
actuate.Parameter.setAutoSuggestDelay
Syntax
void Parameter.setAutoSuggestDelay(long delay)
Sets the autosuggest delay time.
Parameter
delay
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.
function myCustomAutoSuggest(myParameter){
myParameter.setAutoSuggestFetchSize(10);
myParameter.setAutoSuggestListSize(3);
myParameter.setAutoSuggestDelay(250);
}
actuate.Parameter.setAutoSuggestFetchSize
Syntax
void Parameter.setAutoSuggestFetchSize(integer size)
Sets the fetch size of the autosuggestion list. Autosuggest fetches all suggestions from the server when the fetch size is not set.
Parameter
size
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.
function myCustomAutoSuggest(myParameter){
myParameter.setAutoSuggestFetchSize(10);
myParameter.setAutoSuggestListSize(3);
myParameter.setAutoSuggestDelay(250);
}
actuate.Parameter.setAutoSuggestListSize
Syntax
void Parameter.setAutoSuggestListSize(integer size)
Sets the length of the autosuggestion list. Autosuggest shows all of the suggestions from the server when the list length is not set.
Parameter
size
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.
function myCustomAutoSuggest(myParameter){
myParameter.setAutoSuggestFetchSize(10);
myParameter.setAutoSuggestListSize(3);
myParameter.setAutoSuggestDelay(250);
}
actuate.Parameter.setReportName
Syntax
void Parameter.setReportName(string reportFile)
Sets the report file from which to get report parameters.
Parameter
reportFile
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:
myViewer.setReportName(document.getElementById("Selector").value);
actuate.Parameter.setService
Syntax
void Parameter.setService(string iPortalURL, actuate.RequestOptions requestOptions)
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
iPortalURL
String. The target Actuate web application URL.
requestOptions
actuate.RequestOptions object. Optional. requestOptions defines URL parameters to send with the authentication request. The URL can also include custom parameters.
Example
This example sets the URL for the Actuate web application service:
paramObj.setService("http://localhost:8700/iportal",myRequestOptions);
actuate.Parameter.setShowDisplayType
Syntax
void Parameter.setShowDisplayType(boolean showDisplayType)
Sets whether localized data is shown or not.
Parameter
showDisplayType
Boolean. True indicates that localized data is shown.
Example
This example hides localized data:
paramObj.setShowDisplayType(false);
paramObj.submit(alert("Localized data hidden.");
actuate.Parameter.submit
Syntax
void Parameter.submit(function callback)
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.
Parameter
callback
Function. The function to execute after the asynchronous call processing is done.
Example
This example calls submit( ) after hiding localized data:
paramObj.setShowDisplayType(false);
paramObj.submit(alert("Localized data hidden."));