com.tibco.forms.client.Form
The com.tibco.forms.client.Form class provides access to the runtime form object. This object enables you to access panes and controls within the form, register handlers for form actions, and access data to be submitted back to the server.
The com.tibco.forms.client.Form class has six fields that are used for setting action handlers. It also implements the methods listed in the table below.
Field | Data Type | Description |
---|---|---|
ACTION_APPLY |
String | Identifies the "apply" action. |
ACTION_CANCEL |
String | Identifies the "cancel" action. |
ACTION_CLOSE |
String | Identifies the "close" action. |
ACTION_RESET |
String | Identifies the "reset" action. |
ACTION_SUBMIT |
String | Identifies the "submit" action. |
ACTION_VALIDATE |
String | Identifies the "validate" action. |
Method | Return
Value |
Description |
---|---|---|
destroy() |
Void | Removes the form from its container and also releases its resources. This can be called by the client application to close the form. |
getFactory() |
Object | Returns the factory object for the given form. This provides access to the BOM JavaScript factories associated with the BOM types used by this form, as documented under the
factory variable available within form action and validation scripts.
Note: This method is not supported when an
iframe is used to load the form using the built-in
iframe integration support.
|
getLoadStats() |
LoadStat | Returns an array of LoadStat objects. Each statistic represents the measurement of a particular phase of the form load. This can be used by applications to report this information in the user interface or otherwise log the information.
To enable collecting load statistics at runtime, the URL used by the client application to load the form should contain the parameter
This method takes an optional callback function as an argument to support
getLoadStats(Function callback) The callback function is optional for
The method still returns the value in
form.getLoadStats(function(loadStats){ for (idx in loadStats) alert(loadStats[idx].label + ": " + (loadStats[idx].endTime - loadStats[idx].startTime) + " ms"; }); To use the
|
getLocale() |
String | Returns the string representation of the locale being used to render the form.
This method takes an optional callback function as an argument to support
getLocale(Function callback) The callback function is optional for
The method still returns the value in
form.getLocale(function(locale) { alert("Form Locale is: " + locale); }); |
getPackage() |
Object | Returns the object that provides access to the BOM JavaScript package definitions associated with the BOM types used by this form, as documented under the
pkg variable available within form action and validation scripts.
Note: This method is not supported when an
iframe is used to load the form using the built-in
iframe integration support.
|
getResource() |
Object | Returns the object that provides access to the resource bundles associated with this form, as documented under the
resource variable available within form action and validation scripts.
Note: This method is not supported when an
iframe is used load the form using the built-in
iframe integration support.
|
getSerializedParameters () |
String | Returns a JSON representation of the data being managed by the form. This is typically called from a submit handler in order to send the final results back to the server.
This method takes an optional callback function as an argument to support
getSerializedParameters(Function callback) The callback function is optional for
The method still returns the value in
form.getSerializedParameters(function(data) { alert('form data: ' + data); }); |
setActionHandler( String actionName, Function handler) |
Void | Adds a handler to the form that is invoked when the specified action is invoked in the form. Note that any handler already registered for this action is replaced by this handler. The parameter details are as follows:
|
setLocale(String locale) |
Void | Sets the string representation of the locale currently being used to render the form. For example, "en " or "en_US ".
|