JavaScript

{dialog.object}getPointer Method

Syntax

{dialog.object}.getPointer(variableName);

Arguments

variableNamestring

The name of the control in the UX Component

Returns

resultobjectboolean

Returns the HTML DOM element for the requested control. If no element exists, getPointer() returns false.

Description

Get a pointer to the DOM element for a UX component control.

Discussion

Get a pointer to the DOM element for a control, such as a text box, button, label, etc. so that you can manipulate the DOM element. Prefer to use this method over document.getElementById.

If the HTML element doesn't exist, getPointer() will return false. You should always check the returned value of the getPointer() method before using the object. This can be done by wrapping your code in an if block as shown in the example.

//Get a pointer to the container called 'CONTAINER_1'
var containerEle = {dialog.object}.getPointer('CONTAINER_1');

if (containerEle) {
    //Object exists
}

//Get a pointer to the button 'BUTTON_1'
var buttonEle = {dialog.object}.getPointer('BUTTON_1');

if (buttonEle) {
    //Object exists
}

// REPEATING SECTIONS

//Get the instance number for row 3
var row = {dialog.object}._repeatingSectionLogicalToPhysicalRow('SECTION_1',3);

//Get a pointer to text box 'TEXT_1' in row 3 of a Repeating Section
var textEle = {dialog.object}.getPointer('TEXT_1_A5INSTANCE'+row);

if (textEle) {
    //Object exists
}

See Also