Pre-General Availability: 2018-9-20

Non-namespace APIs

QuickNav

Functions

$d_ClearAndHide(pNd)

Clears the content of a DOM node or array of DOM nodes and hides them.
Parameters:
Name Type Description
pNd Element | string | Array.<Element> The node(s) to clear and hide.

$d_Find(pThis, pString, pTags, pClass)

Hides child nodes of a DOM node (pThis) where the child node's content matches any instance of regexp (pString). To narrow the child nodes searched by specifying a tag name (pTag) or a class name (pClass). Note that the child node will be set to a block level element when set to visible.
Parameters:
Name Type Description
pThis Element | String
pString String
pTags String
pClass String
Deprecated:
  • Yes

$dom_AddInput(pThis, pTypeopt, pIdopt, pNameopt, pValueopt) → {Element}

Inserts the html form input element (pType) as a child node of a DOM node (pThis) with an id (pId) and name (pName) value set to (pValue).
Parameters:
Name Type Attributes Description
pThis Element | string
pType String <optional>
The input type. The default is "text".
pId String <optional>
The input element id.
pName String <optional>
The input element name.
pValue String <optional>
The input element value.
Returns:
The element inserted.
Type
Element

$dom_AddTag(pThis, pTagopt, pTextopt) → {Element}

Inserts the html element (pTag) as a child node of a DOM node (pThis) with the innerHTML set to (pText).
Parameters:
Name Type Attributes Description
pThis Element | string The DOM node to append the new element to.
pTag String <optional>
The new element tag.
pText String <optional>
The new element content.
Returns:
The DOM node inserted.
Type
Element

$dom_MakeParent(pThis, pParent) → {Element}

Takes a DOM node (p_Node) and makes it a child of DOM node (p_Parent) and then returns the DOM node (pNode).
Parameters:
Name Type Description
pThis Element | string DOM node or string ID
pParent Element | string DOM node or string ID
Returns:
Type
Element

$f_CheckAll(pThis, pCheck, pArray)

Check or uncheck (pCheck) all check boxes contained within a DOM node (pThis). If an array of checkboxes DOM nodes (pArray) is provided, use that array for affected check boxes.
Parameters:
Name Type Description
pThis Element | string The DOM node or string id of the DOM node that contains the checkboxes.
pCheck boolean true to check and false to uncheck.
pArray Array.<Element> Checkbox elements.

$f_CheckFirstColumn(pNd) → {Array.<Element>}

This function sets all checkboxes located in the first column of a table based on the checked state of the calling checkbox (pNd), useful for tabular forms.
Parameters:
Name Type Description
pNd Element | String
Returns:
Type
Array.<Element>

$f_DisableOnValue(pThis, pValue, pThat) → {boolean}

Checks the value (pValue) of an item (pThis). If it matches, this function disables the item or array of items (pThat). If it does not match, then the item is enabled.
Parameters:
Name Type Description
pThis Element | string
pValue String
pThat Element | string | Array.<Element>
Returns:
Type
boolean

$f_First_field(pNd) → {true}

Places the user focus on the a form item (pNd). If pNd is not found then this function places focus on the first found user editable field.

Use item#setFocus instead.

Parameters:
Name Type Description
pNd Element | String
Deprecated:
  • Yes
Returns:
if successful
Type
true

$f_get_emptys(pNd, pClassFailopt, pClassopt) → {false|Array}

Checks an item or an array of items to see if any are empty, set the class of all items that are empty to pClassFail, set the the class of all items that are not empty to pClass.
Parameters:
Name Type Attributes Description
pNd Element | string | Array.<Element>
pClassFail String <optional>
pClass String <optional>
Returns:
Array of all items that are empty
Type
false | Array

$f_Hide_On_Value_Item(pThis, pThat, pValue) → {boolean}

Checks page item’s (pThis) value against a value (pValue). If it matches, a DOM node (pThat) is set to hidden. If it does not match, then the DOM node (pThat) is set to visible.
Parameters:
Name Type Description
pThis Element | string
pThat Element | string | Array.<Element>
pValue Number | String | Array
Returns:
Type
boolean

$f_Hide_On_Value_Item_Row(pThis, pThat, pValue) → {boolean}

Checks the value (pValue) of an item (pThis). If it matches, this function hides the table row that holds (pThat). If it does not match, then the table row is shown.
Parameters:
Name Type Description
pThis Element | string
pThat Element | string | Array.<Element>
pValue Number | String | Array
Returns:
Type
boolean

$f_ReturnChecked(pNd) → {Array}

Returns an item value as an array. Useful for radio items and checkboxes.
Parameters:
Name Type Description
pNd Element | string
Returns:
Type
Array

$f_SelectedOptions(pNd) → {Array.<Element>|Element|false}

Returns the DOM nodes of the selected options of a select item (pNd).
Parameters:
Name Type Description
pNd Element | string
Returns:
The selected option elements or false if none selected.
Type
Array.<Element> | Element | false

$f_SelectValue(pNd) → {Array|String}

Returns the values of the selected options of a select item (pNd).
Parameters:
Name Type Description
pNd Element | string
Returns:
Type
Array | String

$f_SetValueSequence(pArray, pMultiple)

Sets array of form items (pArray) values to sequential number in multiples of (pMultiple).
Parameters:
Name Type Description
pArray Array.<Element>
pMultiple String | Number

$f_Show_On_Value_Item(pThis, pThat, pValue) → {boolean}

Checks an page item’s (pThis) value against a value (pValue). If it matches, a DOM node (pThat) is set to visible. If it does not match, then the DOM node (pThat) is set to hidden.
Parameters:
Name Type Description
pThis Element | string
pThat Element | string | Array.<Element>
pValue Number | String | Array
Returns:
Type
boolean

$f_Show_On_Value_Item_Row(pThis, pThat, pValue) → {boolean}

Checks the value (pValue) of an item (pThis). If it matches, the function shows the table row that holds pThat. If it does not match then the table row is hidden.
Parameters:
Name Type Description
pThis Element | string
pThat Element | string | Array.<Element>
pValue Number | String | Array
Returns:
Type
boolean

$f_Swap(pThis, pThat)

Swaps the form values of two form elements (pThis,pThat).
Parameters:
Name Type Description
pThis Element | String Element or string id for first form element.
pThat Element | String Element or string id for second form element.

$f_ValuesToArray(pThis, pClass, pTag) → {Array.<String>}

Collects the values of form items contained within DOM node (pThis) of class attribute (pClass) and nodeName (pTag) and returns an array.
Parameters:
Name Type Description
pThis Element | string
pClass String
pTag String
Returns:
The collected values.
Type
Array.<String>

$nvl(pTest, pDefault) → {*}

If pTest is empty or false return pDefault otherwise return pTest.
Parameters:
Name Type Description
pTest *
pDefault *
Returns:
Type
*

$s(pNd, pValue, pDisplayValueopt, pSuppressChangeEventopt)

Given a DOM node or string ID (pNd), this function sets the Application Express item value taking into account the item type. This is a shortcut for item#setValue. See setValue documentation for details.
Parameters:
Name Type Attributes Description
pNd Element | string The DOM node or string id of the item to set the value on.
pValue string | Array.<string> The value to set. For items that support multiple values (for example a 'Shuttle'), an array of string values can be passed to set multiple values at once.
pDisplayValue string <optional>
The display value only if different from pValue and can't be determined by the item itself. For example for the item type Popup LOV, with the attribute Input Field = 'Not Enterable, Show Display Value and Store Return Value', this value sets the Input Field display value. The value of pValue is used to set the item's hidden return field.
pSuppressChangeEvent boolean <optional>
Pass true to prevent the change event from being triggered for the item being set. The default is false.

$tr_AddTD(pThis, pText) → {Element}

Appends a table cell <td> to a table row (pThis). And sets the content to (pText).
Parameters:
Name Type Description
pThis Element | string
pText String
Returns:
Type
Element

$tr_AddTH(pThis, pText) → {Element}

Appends a table header cell <th> to a table row (pThis). And sets the content to (pText).
Parameters:
Name Type Description
pThis Element | string
pText String
Returns:
Type
Element

$u_ArrayToString(pArray, pDelim)

Given an array (pArray) return a string with with the values of the array delimited with a given delimiter character (pDelim).

Use pArray.join(pDelim) as a better replacement.

Parameters:
Name Type Description
pArray Array
pDelim String
Deprecated:
  • Yes

$u_Carray(pNd) → {Array}

Given a DOM node or string ID or an array (pNd), this function returns an array. Used for creating DOM based functionality that can accept a single or multiple DOM nodes.
Parameters:
Name Type Description
pNd Element | string | Array
Returns:
Type
Array

$u_Narray(pNd) → {Array}

Given a DOM node or string ID or an array (pNd), this function returns a single value, if an pNd is an array but only has one element the value of that element is returned otherwise the array is returned. Used for creating DOM based functionality that can accept a single or multiple DOM nodes.
Parameters:
Name Type Description
pNd Element | string | Array
Returns:
Array or first value
Type
Array

$u_SubString(pText, pMatch) → {boolean}

Returns a true or false if a string (pText) contains a substring (pMatch).

Better to ensure values are strings and use indexOf. Or use a regular expression.

Parameters:
Name Type Description
pText String
pMatch String
Deprecated:
  • Yes
Returns:
Type
boolean

$v(pNd)

Given a DOM node or string ID (pNd), this function returns the value of an Application Express item in the same format as it would be posted. See item#getValue for more details.
Parameters:
Name Type Description
pNd Element | string

$v2(pNd)

Given a DOM node or string ID (pNd), this function returns the value of an Application Express item as a string or an array if the item type can contain multiple values. For example checkbox or multi select list. See item#getValue for more details.
Parameters:
Name Type Description
pNd Element | string

$v_Array(pNd) → {Array}

Returns an item value as an array. Useful for multiselects and checkboxs.
Parameters:
Name Type Description
pNd Element | string
Returns:
Type
Array

$v_CheckValueAgainst(pThis, pValue) → {boolean}

Checks an page item’s (pThis) value against a set of values (pValue). This function returns true if any value matches.
Parameters:
Name Type Description
pThis Element | string
pValue Number | String | Array
Returns:
Type
boolean

$v_Upper(pNd)

Sets the value of a form element (pNd) to uppercase. Note this does not go through the item setValue method so this will not work with all item types or trigger a change event.
Parameters:
Name Type Description
pNd Element | String

$x(pNd) → {Element|false}

Given a DOM node or string ID (pNd), this function returns a DOM node if the element is on the page, or returns false if it is not.
Parameters:
Name Type Description
pNd Element | string
Returns:
Type
Element | false

$x_ByClass(pClass, pNdopt, pTagopt) → {Array}

Returns an array of DOM nodes by a given class name (pClass). If the pNd parameter is provided, then the returned elements will be all be children of that DOM node. Including the pTag parameter further narrows the list to just return nodes of that tag type.
Parameters:
Name Type Attributes Description
pClass String
pNd Element | string <optional>
pTag String <optional>
Returns:
Type
Array

$x_CheckImageSrc(pNd, pSearch) → {boolean}

Checks an image (pNd) source attribute for a substring (pSearch). The function returns true if a substring (pSearch) is found. It returns false if a substring (pSearch) is not found.
Parameters:
Name Type Description
pNd Element | string
pSearch String
Returns:
Type
boolean

$x_Class(pNd, pClass) → {Element|Array.<Element>}

Sets the className of a DOM node or array of DOM nodes to class (pClass).
Parameters:
Name Type Description
pNd Element | string | Array.<Element>
pClass String The class name to set. Any other class names will be overwritten.
Returns:
Type
Element | Array.<Element>

$x_ClassByClass(pNd, pClass, pTagopt, pClass2opt) → {Element|Array.<Element>}

Sets the className of an array of nodes that are selected by (pNd), (pClass) and (pTag) to class (pClass2). See $x_ByClass and $x_Class.
Parameters:
Name Type Attributes Description
pNd Element | string
pClass String
pTag String <optional>
pClass2 String <optional>
Returns:
Type
Element | Array.<Element>

$x_disableItem(pNd, pTest)

Disables or enables an item or array of items based on (pTest).
Parameters:
Name Type Description
pNd Element | string | Array.<Element>
pTest boolean

$x_FormItems(pNd, pType) → {Array.<Element>}

Returns all form input items contained in a DOM node (pNd) of the given type (pType).
Parameters:
Name Type Description
pNd Element | string
pType String
Returns:
Type
Array.<Element>

$x_Hide(pNd) → {Element|Array}

Hides a DOM node or array of DOM nodes (pNd). This also takes into consideration which type of Application Express item is being hidden.
Parameters:
Name Type Description
pNd Element | string | Array.<Element>
Returns:
Type
Element | Array

$x_HideAllExcept(pNd, pNdArray) → {Element|Array.<Element>}

Hides all DOM nodes referenced in pNdArray and then shows the DOM node referenced by pNd. This is most useful when pNd is also a node in pNdArray.
Parameters:
Name Type Description
pNd Element | string | Array.<Element>
pNdArray Element | String | Array
Returns:
Type
Element | Array.<Element>

$x_HideChildren(pNd)

Hide all all DOM node children of a DOM node (pNd).
Parameters:
Name Type Description
pNd Element | string

$x_HideItemRow(pNd)

Given a page item name, this function hides the entire row that holds the item. In most cases, this is the item and its label. This function only works in table layouts since it explicitly looks for a containing tr element.
Parameters:
Name Type Description
pNd Element | string | Array.<Element>

$x_HideSiblings(pNd) → {Array.<Element>}

Hides all sibling nodes of given DOM node (pNd).
Parameters:
Name Type Description
pNd Element | string
Returns:
Type
Array.<Element>

$x_ItemRow(pNd, pFunc)

Given DOM node or array of DOM nodes, this function (shows, hides, or toggles) the entire row that contains the DOM node or array of DOM nodes. This is most useful when using Page Items. This function only works in table layouts since it explicitly looks for a containing tr element.
Parameters:
Name Type Description
pNd Element | string | Array.<Element>
pFunc String One of 'TOGGLE', 'SHOW', 'HIDE'

$x_Remove(pNd) → {Element|Array}

Removes a DOM node or array of DOM nodes.
Parameters:
Name Type Description
pNd Element | string | Array.<Element>
Returns:
Type
Element | Array

$x_RowHighlight(pThis, pColor)

Give an table row DOM node (pThis), this function sets the background of all table cells to a color (pColor). A global variable gCurrentRow is set to the current table row (pThis).
Parameters:
Name Type Description
pThis Element | String
pColor String

$x_RowHighlightOff(pThis)

Give an table row DOM node (pThis), this function clears the background of all table cells.
Parameters:
Name Type Description
pThis Element | String

$x_SetSiblingsClass(pNd, pClass, pNdClassopt) → {Array.<Element>}

Sets the class (pClass) of all DOM node siblings of a node (pNd). If pNdClass is not null the class of pNd is set to pNdClass.
Parameters:
Name Type Attributes Description
pNd Element | string
pClass String
pNdClass String <optional>
Returns:
Type
Array.<Element>

$x_Show(pNd) → {Element|Array}

Shows a DOM node or array of DOM nodes (pNd). This also takes into consideration which type of Application Express item is being shown.
Parameters:
Name Type Description
pNd Element | string | Array.<Element>
Returns:
Type
Element | Array

$x_ShowAllByClass(pNd, pClass, pTagopt)

Show all the DOM node children of a DOM node (pNd) that have a specific class (pClass) and tag (pTag).
Parameters:
Name Type Attributes Description
pNd Element | string
pClass String
pTag String <optional>

$x_ShowChildren(pNd)

Show all all DOM node children of a DOM node (pNd).
Parameters:
Name Type Description
pNd Element | string

$x_ShowItemRow(pNd)

Given a page item name, this function shows the entire row that holds the item. In most cases, this is the item and its label. This function only works in table layouts since it explicitly looks for a containing tr element.
Parameters:
Name Type Description
pNd Element | string | Array.<Element>

$x_ShowSiblings(pNd) → {Array.<Element>}

Shows all sibling DOM nodes of given DOM nodes (pNd).
Parameters:
Name Type Description
pNd Element | string
Returns:
Type
Array.<Element>

$x_Style(pNd, pStyle, pString) → {Element|Array.<Element>}

Sets a specific style property (pStyle) to given value (pString) of a DOM node or DOM node Array (pNd).
Parameters:
Name Type Description
pNd Element | string | Array.<Element>
pStyle String
pString String
Returns:
Type
Element | Array.<Element>

$x_SwitchImageSrc(pNd, pSearch, pReplace) → {Element|false}

Checks an image (pId) src attribute for a substring (pSearch). If a substring is found, this function replaces the image entire src attribute with (pReplace).
Parameters:
Name Type Description
pNd Element | string
pSearch String
pReplace String
Returns:
Type
Element | false

$x_Toggle(pNd) → {Element|Array}

Toggles (shows or hides) a DOM node or array of DOM nodes (pNd).
Parameters:
Name Type Description
pNd Element | string | Array.<Element>
Returns:
Type
Element | Array

$x_ToggleItemRow(pNd)

Given a page item name (pNd), this function toggles (shows or hides) the entire row that holds the item. In most cases, this is the item and its label. This function only works in table layouts since it explicitly looks for a containing tr element.
Parameters:
Name Type Description
pNd Element | string | Array.<Element>

$x_ToggleWithImage(pThis, pNd) → {Element}

Given an image element (pThis) and a DOM node (pNd), this function toggles the display of the DOM node (pNd). The src attribute of the image element (pThis) is rewritten. The image src has any plus substrings replaced with minus substrings or minus substrings are replaced with plus substrings.
Parameters:
Name Type Description
pThis Element | string
pNd Element | string | Array.<Element>
Returns:
Type
Element

$x_UpTill(pNd, pToTag, pToClassopt) → {Element|false}

Starting from a DOM node (pNd), this function cascades up the DOM tree until the tag of node name (pToTag) is found. If the optional pToClass is present, the ancestor node must have a node name that equals pToTag and the class must equal pToClass.
Parameters:
Name Type Attributes Description
pNd Element | string
pToTag String
pToClass String <optional>
Returns:
The matching DOM node found and false otherwise.
Type
Element | false

$x_Value(pNd, pValue)

Sets the value (pValue) of a DOM node or array of DOM nodes (pNd).
Parameters:
Name Type Description
pNd Element | string | Array.<Element>
pValue String

addLoadEvent(pFunction)

Adds an onload function (pFunction) without overwriting any previously specified onload functions. The function runs when the DOM is ready (not in response to the load event).

It is better to use apex.jQuery(function);.

Parameters:
Name Type Description
pFunction function The name of a function to run when the DOM is ready.
Deprecated:
  • Yes

html_RemoveAllChildren(pNd)

Use DOM methods to remove all DOM children of DOM node (pND).
Parameters:
Name Type Description
pNd Element | string

html_SetSelectValue(pId, pValue)

Sets the value (pValue) of a select item (pId). If the value is not found, this functions selects the first option (usually the NULL selection).
Parameters:
Name Type Description
pId Element | String
pValue String