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 six methods. The details of the fields and methods are as follows:

com.tibco.forms.client.Form Class - Field Details

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.

com.tibco.forms.client.Form Class - Method Details

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.

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 tibco_instr with a

value true. Otherwise getLoadStats() method

would return an empty array.

To use getLoadStats() method, the client

application needs to subscribe to PageBus™ event

'com.tibco.forms.form.loaded'. See

com.tibco.forms.client.LoadStat for more details.

getLocale()
String Returns the string representation of the locale being

used to render the form.

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.

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 will be

replaced by this handler. The parameter details are as

follows:

  • actionName - Used to specify the name of the
  • action (e.g. ACTION_CLOSE). If the action is
  • ACTION_SUBMIT, then all the validations in the
  • form will be invoked prior to invoking the
  • callback handlers. If any of the validations fail,
  • then the callback handler will not be invoked.
  • handler - This is the function that is invoked for
  • the specified actionName. The form may have
  • only one handler for each action. If this method is
  • called more than once for the same actionName,
  • the handler set previously will be replaced.
  • Passing in null for this parameter will remove
  • the handler for this particular action. The method
  • signature of the handler function has two
  • arguments: a string for the actionName and the
  • form object.
setLocale(String

locale)
Void Sets the string representation of the locale currently

being used to render the form, e.g. "en" or "en_US".