Item objects
Object | Description | Example | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
item.addClasses(classes) apItem.addClasses(classes) |
Adds a list of custom class names to an item for dynamic CSS styling. The classes parameter can be a single class name, multiple class names separated by spaces, or an Array of class names. If any of the given class names are invalid CSS class names, then no classes are added and false is returned. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.clearRequiredMessage() apItem.clearRequiredMessage() |
Validates the item data, but prevents the required error message from displaying. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.connectEvent(eventName,callbackFunction) apItem.connectEvent(eventName,callbackFunction) |
Connects a function to an event on the item. Useful for utility functions defined in external JavaScript™ files to hook behavior into the item dynamically. Returns a handle object that represents the connection of the function to that event name. That handle can be used to disconnect this same event using item.disconnectEvent. | Connect a listener to the
onItemChange event to make a section
visible. This could be placed in the form
onLoad event:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.disconnectEvent(eventHandle) apItem.disconnectEvent(eventHandle) |
Disconnects the event handler specified by the
passed-in event handle object that was returned by an
item.connectEvent call. If you connect an item event, you must also disconnect it in the same event. Otherwise, multiple versions of the connected code are attached every time the event is triggered. |
If the connect event is placed in the item
onShow then the listener needs to be
disconnected:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getActive() apItem.getActive() |
Returns true if this item is active, or false if it is made read only by a rule, stage, or JavaScript™. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apItem.getAppPage() | Returns the page object to which this item belongs. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getBO() | Returns the Business Object for the entire form. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getBOAttr() | An interface item that is collecting data, this method returns the Business Object Attribute that contains that data. If it is an interface-only item, then it returns null. | Get data for an item and set its
value:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getChildren() | If this item contains children, for example Section, or Tab Folder, it returns a list object that provides access to all direct children items. The list object has the getLength() function and get(index) function for accessing the objects in the list. | Rest all numbers inside a section to
0:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getClasses() apItem.getClasses() |
Returns an Array of custom class names currently applied to an item. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getDisplayValue() apItem.getDisplayValue() |
Returns the current value that is being displayed. It can be used in onItemLiveChange to get current, but not yet committed value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getHoverText() apItem.getHoverText() |
Returns the current value set as hover text. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getHintText() apItem.getHintText() |
Returns the value set as Hint text. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getId() apItem.getId() |
Returns the unique ID, within the application, of this item. For example, F_FirstName. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apItem.getInvalidMessage() | An interface item that is collecting data, this method returns the Business Object Attribute that contains that data. If it is an interface-only item, then it returns null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getPage() | Returns the page object to which this item belongs. | Get the form
object:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getParent() apItem.getParent() |
Returns the object that is the direct parent of the item, which can be a page, section, or tab folder. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getPlaceholderText() apItem.getPlaceholderText() |
Returns the current value set as place holder text. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apItem.getRequired() | An interface item that is collecting data, this method returns the Business Object Attribute that contains that data. If it is an interface-only item, then it returns null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getRows() | Returns the current value set as the number of
rows displayed. This method gets the number of rows the text area
displayed. Note: This parameter works only on multi-line input
areas. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getStartLabel() | This method gets the value of the label displayed at the start of a numeric or choice slider. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getStopLabel() | This method gets the value of the label displayed at the end of a numeric or choice slider. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getStyle() | Returns the current value set for display style.
Note: This parameter works only on Date
and Time input fields. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getTitle() apItem.getTitle() |
Returns the current value used as the field title. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getType() apItem.getType() |
Returns a string identifying the object type. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apItem.getValid() | An interface item that is collecting data, this method returns the Business Object Attribute that contains that data. If it is an interface-only item, then it returns null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getValue() apItem.getValue() |
Returns the current value. Its type depends on the data type. For example, String [check and radio list objects return a delimited list with _#_ as the delimiter], Number [number, currency], Boolean, Date [date, timestamp, time], or Object [attachment]. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getVisible() apItem.getVisible() |
Returns true if this item is visible (does not take into account which page is being shown) or false if it is hidden by a rule, stage, or JavaScript™, or if its parent is hidden. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apItem.isMissing() | An interface item that is collecting data, this method returns the Business Object Attribute that contains that data. If it is an interface-only item, then it returns null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apItem.isRequired() | An interface item that is collecting data, this method returns the Business Object Attribute that contains that data. If it is an interface-only item, then it returns null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apItem.isValid() | An interface item that is collecting data, this method returns the Business Object Attribute that contains that data. If it is an interface-only item, then it returns null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.removeClasses(classes) apItem.removeClasses(classes) |
Removes a list of custom class names from an item for dynamic CSS styling. The classes parameter can be a single class name, multiple class names separated by spaces, or an Array of class names. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setActive(active) apItem.setActive(active) |
Sets whether this item is inactive, or read only.
Note: If this item is made inactive by a rule or stage, then you
cannot make it active with JavaScript™. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setDisplayValue(pValue) apItem.setDisplayValue(pValue) |
Takes a string or number in pValue. This method sets the value being displayed. If the user is editing, then it will update the value they are trying to enter. If the user is not editing, then it will be the same as setValue(). This method works on direct input items such as single line, multi line, number, currency, email and website. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setFocus() apItem.setFocus() |
Causes this item to receive focus. This option has no effect on items that cannot have focus, are invisible, or are read-only. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setHintText(pValue) apItem.setHintText(pValue) |
Takes a pValue string. This method sets the text that is used for hover text on input items. If an empty value is provided, the hint text area is removed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setHoverText(pValue) apItem.setHoverText(pValue) |
Takes a pValue string. This method sets the text that is used for Hint text on input items. If an empty value is provided, no hover help is displayed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apItem.setRequired(required) | An interface item that is collecting data, this method returns the Business Object Attribute that contains that data. If it is an interface-only item, then it returns null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setRows(pValue) | Takes a pValue number. This
method sets the number of rows the text area displays. Note: Whenever
possible, do not exceed 40 rows. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setPlaceholderText(pValue) apItem.setPlaceholderText(pValue) |
Takes a pValue string. This method sets the text used as placeholder text on input items. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setStartLabel(pValue) | Takes a pValue string. This method sets the value of the label displayed at the start of a numeric or choice slider. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setStopLabel(pValue) | Takes a pValue string. This method sets the value of the label displayed at the end of a numeric or choice slider. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setStyle(pValue) | Takes a pValue string. This method sets the style used to display time and dates. Valid values are numeric, short, medium, long, and full. Valid values for time are numeric, short and medium. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setTitle(pValue) apItem.setTitle(pValue) |
Takes a pValue string. This method sets the text used for a field titles on input items. If an empty value is provided, the title is removed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apItem.setValid(valid, msg) | An interface item that is collecting data, this method returns the Business Object Attribute that contains that data. If it is an interface-only item, then it returns null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setValue(pValue) apItem.setValue(pValue) |
Sets the value of this data item. The correct data type should be
provided based on the Business Object Attribute’s type. Some
type conversion is done where possible, for example, a Number
converted to a String.
Note: The attachment data takes an object
with a uid property, an id property, and a filename
property. Modifying attachment data is not recommended in
most circumstances. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setVisible(visible) apItem.setVisible(visible) |
Sets whether this item is visible. Note: If this
item is made invisible by a rule or stage, or because a parent
is hidden, then you cannot unhide it by calling this
function. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
apItem.validate() | An interface item that is collecting data, this method returns the Business Object Attribute that contains that data. If it is an interface-only item, then it returns null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.getColumnHeaders() |
Returns a JSON object that contains the id, title and width of each header displayed for the table. Sample JSON output:
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
item.setColumnHeaders(headers) |
Function accepts a JSON object that can be used to set the id, title and width of each column in the table. This is helpful, for example, to change the language of the column header displayed. |
|
Object | Description | Example |
---|---|---|
item.getOptions() | Returns the array of options currently shown in
the drop-down. Each object in the array has a titleproperty that is shown in the interface, and a valueproperty that is saved into the data. |
Get the title of a specific dropdown
value:
|
item.setOptions(options) | Changes the list of options to show in the
drop-down. It must be an array of objects. Each object must have a
titleproperty that is shown in the interface, and a valueproperty that is saved into the data. |
Provide custom list for the
drop-down:
|
Object | Description |
---|---|
item.setDisplayValue(display) | Sets the display value that the user sees as the link in the browser. |
item.setLinkValue(link) | Sets the URL to which the link navigates when this item is clicked. |
Object | Description |
---|---|
item.getContent() | Gets the currently shown content for this interface item. |
item.setContent(content) | Shows content in this interface only item. The content is evaluated as HTML code. |
Object | Description |
---|---|
item.setContent(content) | Shows content in this interface-only item. In Text, it is the raw text to show, no special formatting is supported. |
Object | Description |
---|---|
item.setContent(content) | Sets the label that is shown on the button. |
Object | Description |
---|---|
item.getHeight() | Returns the current image height. Can be zero or blank. |
item.getURL() | Gets the current URL shown by this image item. |
item.getWidth() | Returns the current image width. Can be zero or blank. |
item.setHeight(height) | Sets explicit height in pixels for the image.
Setting 0removes the explicit height. |
item.setURL(newURL) | Sets the URL shown by this image item. |
item.setWidth(width) | Sets explicit width in pixels for the image.
Setting 0removes the explicit width. |
Object | Description |
---|---|
item.getExpanded() | Returns true if the section is expanded and false if it is collapsed. |
item.setExpanded(expanded) | Sets the expanded state of the section. If true, the section is expanded. If false, then it is collapsed. |
Object | Description | Example |
---|---|---|
item.getSelectionIndex() | Returns the index of the currently selected tab. | Set 12 into the first item in the currently shown
tab:
|
item.getTabTitleList() | Returns an array of all the tab titles in this folder. | |
item.setSelectedTab(tabTitle) | Takes a tabTable string. Selects the Tab that matches the tabTable string. | |
item.setTabTitle(tabIndex,pTitle) | Updates the title of a tab within a Tabbed Folder by using a tabIndex integer and pTitle string value. tabIndex denotes the location of the tab within the list of available tabs from left-to-right. For bidirectional languages, the order is right-to-left. |
On the form, a Tabbed folder contains 5 tabs: Red, Orange, Yellow, Green, Blue. The default start number of the tabIndex is 0. In our example tabbed folder, the tabIndex number 0 is the Red tab which is furthest left, while 4 is the tab furthest to the right. In a bidirectional language, the order is reversed. Tab 0 is assigned to Blue, which is the tab furthest to the right. |
item.setTabTitleList(pTitleArray) | Updates the titles of tabs within a Tabbed Folder from a list of strings by using a pTitleArray array of string values. The list of tabs is updated respective to the order of strings that are defined in the array. If there are more array values than tabs in the form, the additional values are ignored. |
|
Object | Description | Example |
---|---|---|
item.getSelection() | Returns the Business Object of the selected row or null if there is no selection. | |
item.setSelection(BO) | Selects the last Business Object in the table. | Select that last row in the
table:
|
item.showAdd(show) | If show is true, then the
Add button is made visible. If false, then the Add button is hidden. |
|
item.showEdit(show) | If show is true, then the
Edit button is made visible. If false, then the Edit button is hidden. |
|
item.showRemove(show) | If show is true, then the
Remove button is made visible. If false, then the Remove button is hidden. |
Object | Description |
---|---|
item.getOptions() | Returns an array of all the options for the survey questions. Each option has a value property, that gets saved in the data, and a display property, the title of at the beginning of the survey. |