pp108 : Form

Form

A Form is the basic component of Process Platform XForms. Forms are created using the XForms Designer.

Properties, Events, and Methods of a Form

The properties, methods, and events associated with the Form define its behavior. You can set the properties and events of a Form through its property sheet or programmatically using the APIs. The methods of the Form can be accessed through the 'window' object of the Form. For example the translate() method of a form can be executed as window.translate().

Table 1. List of Properties

Design-time property

Description

Javascript

Sets the location (URL) for JavaScript script files that are attached to the XForm. It contains a table through which any number of script files can be attached to the XForm. The script files provided here are loaded when the XForm is loading, and will be ready before the Init event of the XForm is executed.

Stylesheet

Stylesheet Sets the location (URL) of all the style sheets that are attached to the XForm. It contains a table through which any number of style sheets (CSS) can be attached to the XForm. All the style sheets are loaded before theInitevent of the XForm is executed.

Class Name

Sets and retrieves the class name applied on the XForm.

Form Messages

Sets validation messages specific to actions performed on an XForm. Using this, you can customize the default validation messages that appear on the XForm. You can specify the messages to be displayed when an unsaved XForm is closed or when it is closed without saving the changes made to a synchronized dialog.

Set Focus at Startup

Sets the property by which the focus is set on the first editable control on an XForm when the XForm is loaded. This property takes precedence over the Tab Index property of controls.

Transitional

Enables multiple-browser compliance for the XForm. This sets the DOCTYPE declaration and necessary CSS classes for the XForm, thereby making it multi-browser ready. However, in order to achieve complete and working multiple browser support for the XForm, see Enabling Multi-browser Support for Web Content.

Table 2. List of Events

Event

Description

Init

Activates before the request is fired to the backend, for the form data.

Init Done

Activates when the data from the backend is received and the form has been rendered.

Before Close

Activates before the form is closed.

Before CompleteTask

Activates before a task is completed.

Table 3. List of Methods

Method

Description

addListener()

This method registers the control to receive notifications for an event.

removeListener()

This method unregisters the control to cease receiving notifications for its events.

translate (sValue)

This method translates the string that is passed as a parameter, to the current language in which the form is running.