Actuate JavaScript API classes : Class actuate.parameter.ParameterDefinition

Class actuate.parameter.ParameterDefinition

Description

The ParameterDefinition object contains all of the qualities, values, names, and conditions for a parameter. A ParameterDefinition object can display options to the user and respond to user-generated events. The actuate.Parameter class downloads an array of ParameterDefinition objects with downloadParameters( ). The order of this array is also the order in which the parameters are displayed. Parameters can be grouped to divide the parameters on the page into logical sets under a heading.

This class requires significant memory and bandwidth resources. ParameterValue is much smaller than ParameterDefinition. ParameterValue is the more efficient way to communicate to the server that a parameter value has changed.

Constructor

Syntax

actuate.parameter.ParameterDefinition( )

Constructs a new ParameterDefinition object.

Function summary

Table 4-23 lists actuate.parameter.ParameterDefinition functions.

Gets the auto suggest current display name for the current value of this ParameterDefinition.
Gets the group value for this ParameterDefinition.
Gets the name value for this ParameterDefinition.
Sets the group value for this ParameterDefinition.

actuate.parameter.ParameterDefinition.getAutoSuggestThreshold

Syntax

integer ParameterDefinition.getAutoSuggestThreshold( )

Gets the autosuggest threshold value for this ParameterDefinition. The autosuggest threshold determines the number of characters a user types in before they are given suggestions from autosuggest.

Returns

Integer.

Example

To store the autosuggest threshold of the parameter definition paramdef in a variable called threshold, use code similar to the following:

var threshold = paramdef.getAutoSuggestThreshold( );

actuate.parameter.ParameterDefinition.getCascadingParentName

Syntax

string ParameterDefinition.getCascadingParentName( )

Gets the cascadingParentName value for this ParameterDefinition. A cascading parent parameter is only used when on parameter depends upon another.

Returns

String.

Example

To store the cascading parent name of the parameter definition paramdef in a variable called parentname, use code similar to the following:

var parentname = paramdef.getCascadingParentName( );

actuate.parameter.ParameterDefinition.getColumnName

Syntax

string ParameterDefinition.getColumnName( )

Gets the columnName value for this ParameterDefinition. This setting sets the column to retrieve data from for an ad hoc parameter that performs a query.

This setting has no effect on other types of parameters.

Returns

String.

Example

To store the column name of the parameter definition paramdef in a variable called columnname, use code similar to the following:

var columnname = paramdef.getColumnName( );

actuate.parameter.ParameterDefinition.getColumnType

Syntax

string ParameterDefinition.getColumnType( )

Gets the columnType value for this ParameterDefinition. This setting sets the data type queried by an ad hoc parameter that performs a query.

This setting has no effect on other types parameters.

Returns

String. Possible values are: "Currency", "Date", "DateOnly", "Time", "Double", "Integer" "String", "Boolean", "Structure", "Table", "Unknown"

Example

To store the column type of the parameter definition paramdef in a variable called columntype, use code similar to the following:

var columntype = paramdef.getColumnType( );

actuate.parameter.ParameterDefinition.getControlType

Syntax

string ParameterDefinition.getControlType( )

Gets the controlType value for this ParameterDefinition. It determines the form element displayed for the user to set the parameter value.

Returns

String. Possible values are: null, "", "ControlRadioButton", "ControlList", "ControlListAllowNew", "ControlCheckBox"

Example

To store the control type string for the parameter definition paramdef in a variable called controltype, use code similar to the following:

var controltype = paramdef.getControlType( );

actuate.parameter.ParameterDefinition.getCurrent
DisplayName

Syntax

string ParameterDefinition.getCurrentDisplayName( )

Gets the current display name for this ParameterDefinition.

Returns

String.

Example

To store the current display name of the parameter definition paramdef in a variable called displayname, use code similar to the following:

var displayname = paramdef.getDisplayName( );

actuate.parameter.ParameterDefinition.getDataType

Syntax

string ParameterDefinition.getDataType( )

Gets the dataType value for this ParameterDefinition.

Returns

String. Possible values are: "Currency", "Date", "DateOnly", "Time", "Double", "Integer", "String", "Boolean", "Structure", "Table", "Unknown"

Example

To store the data type of the parameter definition paramdef in a variable called type, use code similar to the following:

var type = paramdef.getDataType( );

actuate.parameter.ParameterDefinition.getDefaultValue

Syntax

string ParameterDefinition.getDefaultValue( )

Gets the defaultValue value for this ParameterDefinition, if applicable.

Returns

String.

Example

To store the default value as a string for the parameter definition paramdef in a variable called default, use code similar to the following:

var default = paramdef.getDefaultValue( );

actuate.parameter.ParameterDefinition.getDefaultValueIsNull

Syntax

boolean ParameterDefinition.getDefaultValueIsNull( )

Returns True when the parameter’s default value is null.

Returns

Boolean.

Example

To alert the user that the default value is null for the parameter definition paramdef, use code similar to the following:

if (paramdef.getDefaultValueIsNull( )){
  alert('Default value is null!');
}

actuate.parameter.ParameterDefinition.getDisplayName

Syntax

string ParameterDefinition.getDisplayName( )

Gets the displayName for this ParameterDefinition.

Returns

String.

Example

To store the displayed name for the parameter definition paramdef in a variable called displayname, use code similar to the following:

var displayname = paramdef.getDisplayName( );

actuate.parameter.ParameterDefinition.getGroup

Syntax

string ParameterDefinition.getGroup( )

Gets the group for this ParameterDefinition, indicating if it is a member of a group.

Returns

String.

Example

To print the group name for the parameter definition paramdef to the current document, use code similar to the following:

document.write(paramdef.getGroup( ));

actuate.parameter.ParameterDefinition.getHelpText

Syntax

string ParameterDefinition.getHelpText( )

Gets the helpText for this ParameterDefinition.

Returns

String.

Example

To store the help text for the parameter definition paramdef in a variable called helptext, use code similar to the following:

var helptext = paramdef.getHelpText( );

actuate.parameter.ParameterDefinition.getName

Syntax

string ParameterDefinition.getName( )

Gets the name for this ParameterDefinition.

Returns

String.

Example

To store the name for the parameter definition paramdef in a variable called paramname, use code similar to the following:

var paramname = paramdef.getName( );

actuate.parameter.ParameterDefinition.
getOperatorList

Syntax

string[ ] ParameterDefinition.getOperatorList( )

Gets the operator list for this ParameterDefinition.

Returns

An array of Strings containing the select value list.

Example

To store the list of operators for the parameter definition paramdef in a variable called ops, use code similar to the following:

var ops = new Array( );
ops = paramdef.getOperatorList( );

actuate.parameter.ParameterDefinition.getPosition

Syntax

Integer ParameterDefinition.getPosition( )

Gets the position in the array for this ParameterDefinition.

Returns

Integer.

Example

To store the position of the parameter definition paramdef in a variable called position, use code similar to the following:

var position = paramdef.getPosition( );

actuate.parameter.ParameterDefinition.getSelectNameValueList

Syntax

selectNameValueList[ ] ParameterDefinition.getSelectNameValueList( )

Gets the selectNameValueList for this ParameterDefinition. This list applies if the parameter is set with a selection list.

Returns

Array of actuate.parameter.NameValuePair objects.

Example

To retrieve the name-value pair list for the parameter definition paramdef and put it into a new array, use code similar to the following:

var namevalues = new array( );
namevalues = paramdef.getSelectNameValueList( ).slice( );

actuate.parameter.ParameterDefinition.getSelectValueList

Syntax

string[ ] ParameterDefinition.getSelectValueList( )

Gets the selectValueList for this ParameterDefinition. This list applies when the parameter is set with a selection list.

Returns

Array of Strings.

Example

To retrieve the list of values selectable for the parameter definition paramdef and put it into a new array, use code similar to the following:

var selectvalues = new array( );
selectvalues = paramdef.getSelectValueList( ).slice( );

actuate.parameter.ParameterDefinition.isAdHoc

Syntax

boolean ParameterDefinition.isAdHoc( )

Gets the isAdHoc for this ParameterDefinition.

Returns

Boolean. True indicates that this parameter is an ad hoc parameter.

Example

To set the default value to null for the parameter definition paramdef if it is an ad hoc parameter, use code similar to the following:

if (paramdef.isAdHoc( )){
  paramdef.setDefaultValueIsNull(true);
}

actuate.parameter.ParameterDefinition.isHidden

Syntax

boolean ParameterDefinition.isHidden( )

Gets the isHidden value for this ParameterDefinition.

Returns

Boolean. True indicates that this parameter is hidden.

Example

To reveal a parameter with the parameter definition paramdef if it is hidden, use code similar to the following:

if (paramdef.isHidden( )){
  paramdef.setIsHidden(false);
}

actuate.parameter.ParameterDefinition.isPassword

Syntax

boolean ParameterDefinition.isPassword( )

Gets the isPassword value for this ParameterDefinition.

Returns

Boolean. True indicates that the parameter is a password.

Example

To set the parameter definition paramdef as required if it is a password parameter, use code similar to the following:

if (paramdef.isPassword( )){
  paramdef.setIsRequired(true);
}

actuate.parameter.ParameterDefinition.isRequired

Syntax

boolean ParameterDefinition.isRequired( )

Gets the isRequired value for this ParameterDefinition.

Returns

Boolean. True indicates that the parameter is required.

Example

To set specific help text for the parameter definition paramdef if it is a required parameter, use code similar to the following:

if (paramdef.isRequired( )){
  paramdef.setHelpText("This parameter is required.");
}

actuate.parameter.ParameterDefinition.isViewParameter

Syntax

boolean ParameterDefinition.isViewParameter( )

Gets the isViewParameter value for this ParameterDefinition. True indicates that the parameter is a view-time parameter. False indicates that the parameter is a run-time parameter.

Returns

Boolean.

Example

To set specific help text for the parameter definition paramdef if it is a view-time parameter, use code similar to the following:

if (paramdef.isViewParameter( )){
  paramdef.setHelpText("This is a view-time parameter.");
}

actuate.parameter.ParameterDefinition.setAutoSuggestThreshold

Syntax

void ParameterDefinition.setAutoSuggestThreshold(integer threshold)

Sets the autosuggest threshold for this ParameterDefinition. The autosuggest threshold determines the number of characters a user types in before they are given suggestions from autosuggest.

Parameters

threshold

Integer.

Example

To always show the autosuggest dialog for the parameter definition paramdef, use code similar to the following:

paramdef.setAutoSuggestThreshold(0);

actuate.parameter.ParameterDefinition.setCascadingParentName

Syntax

void ParameterDefinition.setCascadingParentName(string cascadingParentName)

Sets the cascadingParentName for this ParameterDefinition. This sets another parameter as this parameter’s parent.

Parameters

cascadingParentName

String.

Example

To set the parent name of the parameter definition paramdef to Clark, use code similar to the following:

paramdef.setCascadingParentName("Clark");

actuate.parameter.ParameterDefinition.setColumnName

Syntax

void ParameterDefinition.setColumnName(string columnName)

Sets the columnName for this ParameterDefinition. Used for queries.

Parameters

columnName

String.

Example

To set the parameter definition paramdef to access the ProductName column, use code similar to the following:

paramdef.setColumnName("ProductName");

actuate.parameter.ParameterDefinition.setColumnType

Syntax

void ParameterDefinition.setColumnType(string columnType)

Sets the columnType for this ParameterDefinition. Used for queries.

Parameters

columnType

String. Possible values are: "Currency", "Date", "DateOnly", "Time", "Double", "Integer", "String", "Boolean", "Structure", "Table", and "Unknown".

Example

To allow the parameter definition paramdef to interpret a column as untyped data, use code similar to the following:

paramdef.setColumnType("Unknown");

actuate.parameter.ParameterDefinition.setControlType

Syntax

void ParameterDefinition.setControlType(string controlType)

Sets the control type of this ParameterDefinition.

Parameters

controlType

String. Possible values are null, "", "AutoSuggest", "ControlRadioButton", "ControlList", "ControlListAllowNew", and "ControlCheckBox".

Example

To set the parameter definition paramdef to access the ProductName column, use code similar to the following:

paramdef.setControlType("ProductName");

actuate.parameter.ParameterDefinition
.setCurrentDisplayName

Syntax

void ParameterDefinition.setCurrentDisplayName(string currentDiplayName)

Sets the displayed name for this parameter.

Parameters

currentDisplayName

String.

Example

To set the display name for the parameter definition paramdef to Year, use code similar to the following:

paramdef.setCurrentDisplayName("Year");

actuate.parameter.ParameterDefinition.setDataType

Syntax

void ParameterDefinition.setDataType(string dataType)

Sets the dataType for this ParameterDefinition.

Parameters

dataType

String. Possible values are: "Currency", "Date", "DateOnly", "Time", "Double", "Integer", "String", "Boolean", "Structure", "Table", "Unknown"

Example

To set the parameter definition paramdef data type to date, use code similar to the following:

paramdef.setDataType("Date");

actuate.parameter.ParameterDefinition.setDefaultValue

Syntax

void ParameterDefinition.setDefaultValue(string defaultValue)

Sets the default value for this ParameterDefinition.

Parameters

defaultValue

String.

Example

To set the default value of parameter definition paramdef to 2010, use code similar to the following:

paramdef.setDefaultValue("2010");

actuate.parameter.ParameterDefinition.setDefaultValueIsNull

Syntax

void ParameterDefinition.setDefaultValue(boolean value)

When True, sets the default value for this ParameterDefinition to null. Sets the default value to no value in all other cases.

Parameters

value

Boolean.

Example

To set the default value of parameter definition paramdef to null use code similar to the following:

paramdef.setDefaultValueIsNull(true);

actuate.parameter.ParameterDefinition.setDisplayName

Syntax

void ParameterDefinition.setDisplayName(string displayName)

Sets the name to display on the parameter page for this ParameterDefinition.

Parameters

displayName

String.

Example

To set the displayed name of parameter definition paramdef to Year, use code similar to the following:

paramdef.setDisplayName("Year");

actuate.parameter.ParameterDefinition.setGroup

Syntax

void ParameterDefinition.setGroup(string group)

Sets the group value for this ParameterDefinition.

Parameters

group

String.

Example

To assign the parameter definition paramdef to the "Customer Details" parameter group, use code similar to the following:

paramdef.setGroup("Customer Details");

actuate.parameter.ParameterDefinition.setHelpText

Syntax

void ParameterDefinition.setHelpText(string helpText)

Sets the helpText value for this ParameterDefinition.

Parameters

helpText

String.

Example

To set specific help text for the parameter definition paramdef if it is a required parameter, use code similar to the following:

if (paramdef.isRequired( )){
  paramdef.setHelpText("This parameter is required.");
}

actuate.parameter.ParameterDefinition.setIsAdHoc

Syntax

void ParameterDefinition.setIsAdHoc(boolean isAdHoc)

Sets this parameter as an ad hoc parameter.

Parameters

isAdHoc

Boolean. True sets this parameter to ad hoc.

Example

To enable the parameter definition paramdef to accept an ad hoc value, use code similar to the following:

paramdef.setIsAdHoc(true);

actuate.parameter.ParameterDefinition.setIsHidden

Syntax

void ParameterDefinition.setIsHidden(boolean isHidden)

Sets the parameter to hidden.

Parameters

isHidden

Boolean. True hides the parameter.

Example

To hide a parameter defined by a parameter definition called paramdef, use code similar to the following:

paramdef.setIsHidden(true);

actuate.parameter.ParameterDefinition.setIsMultiSelectControl

Syntax

void ParameterDefinition.setIsMultiSelectControl(boolean isMultiSelect)

Sets the parameter to accept multiple selected values.

Parameters

isHMultiSelect

Boolean. True allows multiple selected values to be set for this parameter.

Example

To allow a parameter defined by a parameter definition called paramdef to accept multiple selected values, use code similar to the following:

paramdef.setIsMultiSelectControl(true);

actuate.parameter.ParameterDefinition.setIsPassword

Syntax

void ParameterDefinition.setIsPassword(boolean isPassword)

Sets this parameter to treat its value as a password, which hides the input on the page and encrypts the value.

Parameters

isPassword

Boolean. True indicates a password value.

Example

To set the parameter type accepted by the parameter definition paramdef to password, use code similar to the following:

paramdef.setIsPassword(true);

actuate.parameter.ParameterDefinition.setIsRequired

Syntax

void ParameterDefinition.setIsRequired(boolean isRequired)

Sets the parameter to required.

Parameters

isRequired

Boolean. True indicates a mandatory parameter.

Example

To make the parameter defined by the parameter definition paramdef mandatory, use code similar to the following:

paramdef.setIsRequired(true);

actuate.parameter.ParameterDefinition.setIsViewParameter

Syntax

void ParameterDefinition.setIsViewParameter(boolean isViewParameter)

Sets the isViewParameter value for this ParameterDefinition.

Parameters

isViewParameter

Boolean.

Example

To make the parameter defined by the parameter definition paramdef a view-time parameter, use code similar to the following:

paramdef.setIsViewParameter(true);

actuate.parameter.ParameterDefinition.setName

Syntax

void ParameterDefinition.setName(string name)

Sets the name to use internally for this ParameterDefinition.

Parameters

name

String.

Example

To set the internal name of the parameter definition paramdef to Year, use code similar to the following:

paramdef.setName("Year");

actuate.parameter.ParameterDefinition.setPosition

Syntax

void ParameterDefinition.setPosition(integer position)

Sets the position value for this ParameterDefinition. The index indicates the position in the array of the ParameterDefinition.

Parameters

position

Integer.

Example

To shift the parameter definition paramdef down on position in the parameter array, use code similar to the following:

paramdef.setPosition(++paramdef.getPosition( ));

actuate.parameter.ParameterDefinition.setSelectNameValueList

Syntax

void ParameterDefinition.setSelectNameValueList
(actuate.parameter.NameValuePair[ ] selectNameValueList)

Sets the selectNameValueList value for this ParameterDefinition.

Parameters

selectNameValueList

Array of actuate.parameter.NameValuePair objects.

Example

To set the parameter definition paramdef to select the same name-value list as the parameter definition nparam, use code similar to the following:

paramdef.setSelectNameValueList(nparam.getSelectNameValueList( ));

actuate.parameter.ParameterDefinition.setSelectValueList

Syntax

void ParameterDefinition.setSelectValueList(array[ ] selectValueList)

Sets the selectValueList value for this ParameterDefinition.

Parameters

selectValueList

Array.

Example

To set the parameter definition paramdef to select the values 2007-2009, use code similar to the following:

var values = new Array("2007", "2008", "2009");
paramdef.setSelectValueList(values);
paramdef.setSelectValueList(values);

(c) Copyright Actuate Corporation 2011