Form objects
Table 1. Form Object (form) The form object provides access to a number of functions that affect the entire form.
Object | Description | Example |
form.addClasses(classes) | Adds a list of custom class names to the form 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. |
|
form.backwardPage() | Return the form to the previous page in navigation order. If the first page is reached, then nothing happens. | The following could be used to turn a regular button into a navigation button. In the onClick event of a button:
|
form.connectEvent(eventName, callbackFunction) | Connects a function to an event on the form. This is useful for utility functions defined in external JavaScript™ files to hook behavior into the form dynamically. Returns a handle object that represents the connection of the function to that event name. The handle can be used to disconnect this same event using form.disconnectEvent. | If there is a F_CurrentUser field, then populate the currentUser:
|
form.disconnectEvent(eventHandle) | Disconnects the event handler specified by the passed-in event handle object that was returned by a form.connectEvent call. To avoid duplicate event handlers being connected, connect to events from within the application onStart or form onLoad events. If you connect to an event outside of these two events, you should explicitly disconnect from the event using the disconnectEvent method. |
|
form.forwardPage() | Advance the form to the next page in navigation order. If the last page is reached, then nothing happens. | The following could be used to turn a regular button into a navigation button. In the onClick event of a button:
|
form.getApp() | Returns the application object: app. Not a commonly used function, because within the form scope the app variable is also available. | |
form.getBO() | Returns the object that contains the Business Object data for the entire form.This is commonly used in the application onStart, since at this scope the form variable is not defined. |
|
form.getClasses() | Returns an Array of custom class names currently applied to the form. | |
form.getCurrentPage() |
Gets the currently shown page. If there is no page shown, then null is returned. It is possible, though rarely desirable, to have all pages hidden.
|
|
form.getId() |
Returns the unique ID within the application of this form. For example, 'F_Form1' .
|
|
form.getPageIds() |
Returns an array of the page IDs for the pages in this form. | |
form.getPage(pageId) |
Returns the page object, page, for the page specified. Returns null if the pageId is invalid.
|
Get the specified page:
|
form.getServiceConfigurationIds() | Returns an array of all the IDs for services mapped in this form. |
|
form.getServiceConfiguration(serviceId) | Gets the service object for a particular service ID. |
Lookup and execute a service from JavaScript:
|
form.getStageActions() | Returns an array of all the action buttons for the current stage. This includes any hidden action buttons as well. |
Trigger a specific action using JavaScript:
|
form.getType() |
Returns a string identifying the object type. For example, 'form' .
| |
form.removeClasses(classes) | Removes a list of custom class names from the form 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. |
|
form.removePageFromNavigation(pageId) | Removes the specified page from the navigation list for the form. The page navigation item no longer visits that page when next, or previous is selected, nor can you switch to that page programmatically. |
If the check is selected, remove page 2 from the navigation:
|
form.restorePageNavigation(pageId) | Restores a previously removed page back into the navigation list for the form. |
If the check is not selected, restore page 2 into the navigation:
|
form.selectPage(pageId) | Switches to the specified page. If the page is removed from navigation by Stages, Rules, or JavaScript, then you cannot select it. | Get the specified page:
|
Parent topic: Interface objects