Previous Topic: Standard Scripting FunctionsNext Topic: Standard SQL Helper Functions


search-helper.js

These are the helper functions available by including search-helper.js. Most functions have two forms, one taking the object to be operated on enabling 'this' to be passed from event handlers, and the other taking the name of the parameter.

Note: These functions must be used for updating parameters from javascript, changing values using document.getElementById(‘myparam’).value will not function correctly. This is because the way that data is managed in r12.5 is substantially different from previous releases.

Function name

Description

Argument Name

Argument Description

SH_DisableCheckbox

Changes the disabled state of a checkbox parameter.

obj

The checkbox object

 

 

bDisabled

Disable the checkbox if true

SH_DisableCheckboxByName

As SH_DisableCheckbox but using the checkbox name

sName

The name of the checkbox parameter

 

 

bDisabled

Disable the checkbox if true

SH_DisableList

Changes the disabled state of a list parameter or selected list items.

obj

The list object

 

 

bDisabled

Disable the list or list items if true

 

 

aItems

(Optional) An array of item values to be disabled.

SH_DisableListByName

As SH_DisableList but using the list name.

sName

The name of the list parameter.

 

 

bDisabled

Disable the list or list items if true.

 

 

aItems

(Optional) An array of item values to be disabled.

SH_DisableLookup

Changes the disabled state of a lookup parameter, including associated buttons

obj

The lookup object

 

 

bDisabled

Disable the lookup parameter if true

SH_DisableLookupByName

As SH_DisableLookup but using the checkbox name

sName

The name of the lookup parameter

 

 

bDisabled

Disable the lookup parameter if true

SH_DisableParameter

Changes the disabled state of a parameter. This function handles all parameter types.

obj

The parameter object

 

 

bDisabled

Disable the parameter if true.

SH_DisableParameterByName

As SH_DisableParameter but using the parameter name

sName

The name of the parameter.

 

 

bDisabled

Disable the parameter if true

SH_DisableParameterList

Changes the disabled state of a list of parameters.

sList

The comma-separated list of parameter names.

 

 

bDisabled

Disable the parameters if true

SH_EscapeXmlText

Escapes special characters in the text to ensure valid xml for drilldown parameters.

sText

The text to be escaped.

SH_ExclusiveCheckbox

Disables a list of parameters based on the state of the specified checkbox.

obj

The checkbox object.

 

 

sList

The comma-separated list of names of parameters to be disabled when the checkbox is ticked.

SH_ExclusiveCheckboxByName

Disables a list of parameters based on the state of the specified checkbox.

sName

The checkbox parameter name

 

 

sList

The comma-separated list of names of parameters to be disabled when the checkbox is ticked.

SH_GetName

Gets the name of the parameter or its id if the name is not set.

obj

The parameter object.

SH_SetCheckbox

Sets the checked state of a checkbox parameter. N.B. This function should always be used to set a checkbox programmatically.

obj

The checkbox object.

 

 

bChecked

Tick the checkbox if true

SH_SetCheckboxByName

As SH_SetCheckbox but using the parameter name.

sName

The checkbox parameter name

 

 

bChecked

Tick the checkbox if true

SH_SetListItems

Sets the select state of a list.

obj

The list object.

 

 

bSelected

Item(s) selected when true.

 

 

aItems

An array of item values to be selected.

 

 

bOnChange

(optional) Prevents the OnChange method from firing when false.

SH_SetListItemsByName

Sets the select state of a list but using the list name.

sName

The list parameter name.

 

 

bSelected

Item(s) selected when true.

 

 

aItems

An array of item values to be selected.

 

 

bOnChange

(optional) Prevents the OnChange method from firing when false.

SH_SetTextBox

Sets the text in a textual parameter.

obj

The text object.

 

 

sText

The text to set.

SH_SetTextBoxByName

Sets the text in a textual parameter

sName

The text parameter name

 

 

sText

The text to set.

SH_ClearLookup

Clears a lookup or lookupbyid parameter.

obj

The lookup object.

SH_ClearLookupByName

Clears a lookup or lookupbyid parameter.

sName

The name of the lookup parameter.

SH_UpdateMultiSelect

Update a multi-select list parameter which has an [All] option. De-selects any other selections in the list when the [All] option is selected

obj

The list object

SH_UpdateMultiSelectByName

As SH_UpdateMultiSelect but using the parameter name

sName

The list parameter name

SH_ValidateNumberInRange

Validates the value entered into a numeric parameter as being within the specified range. If not, the value is reset to the default value

obj

The numeric parameter object

 

 

nMin

The range minimum

 

 

nMax

The range maximum

 

 

nDefault

The default value (may be null)

SH_ValidateNumberInRangeByName

As SH_ ValidateNumberInRange but using the parameter name

sName

The numeric parameter name