Mobile Page Element APIs
The following APIs enable you to work with page elements and their data:
disableField(elementName)
Disables an element that is hidden from or displayed on a mobile page.
Parameters
-
elementName {string} [required] – Name of the page element you want to disable
Returns
-
void
enableField(elementName)
Enables an element that is hidden from or displayed on a mobile page.
Parameters
-
elementName {string} [required] – Name of the page element you want to enable
Returns
-
void
getElementSourceData(elementName)
Gets the source data of a dropdown, search grid, or data table element.
Parameters
-
elementName {string} [required] -Name of the page element that contains the source data
Returns
-
Returns the source data for the page element, usually an array of objects
getValueFromPage(elementName)
Gets the value of an element on a mobile page.
Parameters
-
elementName {string} [required] – Name of the page element that contains the value
Returns
-
The value of the page element, in the element’s data type
hideField(elementName)
Hides an enabled or disabled element from a mobile page.
Parameters
-
elementName {string} [required] – Name of the page element you want to hide from a mobile
Returns
-
void
setElementSourceData(elementName, sourceData)
Sets the source data of a dropdown or data table element.
Parameters
-
elementName {string} [required] -Name of the dropdown or data table element to which you want to assign the source data
-
sourceData {Array of objects} [required] – The source data you want to associate with the page element
Returns
-
void
setFocusOnElement(elementName)
Gives focus to any of the following input field elements on a mobile page: Textbox, Date, UOM, or Search Grid.
Parameters
-
elementName {string} [required] -Name of the element you want to assign the focus to
Returns
-
void
setValueInPage(elementName, value)
Sets the value of an element on a mobile page in the following ways:
-
For Action Button elements, it sets the button’s label.
-
For Data Table elements, it selects the row that contains the values.
-
For Data entry or selection elements, it sets the field value.
If no value is provided, it does not select any row from table elements or leaves data entry elements blank.
For the UOM element, the behavior depends on the value you provide:
-
String -Sets the value for the quantity.
-
Object -Sets the value for a single unit and quantity.
-
Array of Objects -Sets or adds rows of units and quantity values.
If no value is provided, it sets the default unit and leaves the quantity blank.
Parameters
-
elementName {string} [required] – Name of the page element to which you want to assign the value
-
value [optional] – Value you want to set in the element, in the element’s data type, as shown in the following table
Data Type |
Page Element |
Example |
---|---|---|
String |
Action Button, Date, Dynamic Text, Search Grid Textbox, UOM |
Action Button example: Enter Item Dynamic Text example:
|
Object |
Data Table, Date, Drop Down, Search Grid, UOM |
Date example:
Drop Down example:
|
Array |
Multi-Select Data Table |
Multi-Select Data Table example:
|
UOM |
UOM example:
|
Returns
-
void
showField(elementName)
Displays an enabled or disabled element on a mobile page.
Parameters
-
elementName {string} [required] – Name of the page element you want to show on a mobile page
Returns
-
void