Skip to main content

FormPage

Last updated 19/01/2026

FormPage Object

The

FormPage
object represents one page (or tab) within a form and is responsible for managing everything that happens on that specific page.

In Five, all events have an instance of the

object as the initial parameter, and this provides a function called

sender() : any
. Using this function we can get the current form page in many situations, below are scenarios depending on the appropriate event:

  • If an event attached to a form page is called (ie,
    OnLeaving
    ), the current form page will be
    five.sender()
    ;
  • If an event attached to a form field is called (ie,
    OnExit
    ), the current form page will be
    five.sender().getParent();

If you are in subforms, you can further call

to move up the form hierarchy if needed.

What the FormPage Object Does

  • Accessses fields on that page
  • Refreshes the page when data changes
  • Reacts to conditions that affect the page
  • Acts as a scope (so you don't affect other pages)

How it Fits With Form Other Objects

  • Form
    object - represents the entire form
  • FormPage
    object - represents a single page/tab inside the form
  • FormField
    object - represents the individual inputs on that page

How the FormPage Object Fits into an Application Flow

A typical lifecycle looks like this:

  1. Form loads - and creates all FormPage instances internally.

  2. FormPage
    is accessed - a specific page is viewed giving you access to its logic and fields.

  3. User interacts - by typing, selecting, or changing values.

  4. Your code reacts - it runs the logic, updates other fields, and shows messages or errors.

  5. Form saves - final validation occurs, and data passed to the backend or workflow.

Summary

The

FormPage
object represents a single page or tab within a form and is responsible for handling page-specific behavior. It reacts to user interaction on that page, evaluates local rules and conditions, and refreshes the page to keep its fields up to date. By isolating logic to a single page, the
FormPage
object helps keep form behavior predictable, efficient, and easy to maintain, while the
Form
object continues to manage the overall form lifecycle and submission.

Functions on the FormPage Object

The following functions are available on the

FormPage
object.

event()

The

is a function on the

FormPage
object that returns the ID of the event that caused the form event logic to run, such as
OnSelecting
. Effectively, it tells you why the form code is executing.

Available: Client

JavaScript
Function Signature
event() : string;

Return value: A string representing the ID of the event that triggered the form page logic.

Examples:
event()

getCaption()

The

is a function on the

FormPage
object that returns the caption for the page. This is the user-visible caption of the page or tab as it appears in the form UI, for example, the text shown on the tab header.

Available: Client

JavaScript
Function Signature
getCaption() : string;

Return value: A string representing the page caption.

Examples:
getCaption()

getDataManager()

The

is a function on the

FormPage
object that returns a
DataManager
object associated with the
FormPage
.

The

DataManager
object is responsible for handling the data layer behind the page, including how the field values are stored, retrieved, validated, and synchronized with the form's underlying data model.

Available: Client

JavaScript
Function Signature
getDataManager() : DataManager;

Return value: A

DataManager
object that is associated to the
FormPage
.

Examples:
getDataManager()

getField()

The

is a function on the

FormPage
object that retrieves a specific field from a
FormPage
by its unique field identifier. It allows your code to directly access and interact with an individual form field without iterating through all fields on the page.

Available: Client

JavaScript
Function Signature
getField(fieldID) : FormField;

ParameterTypeDescription
fieldID
stringThe field ID on the page

Return value: A

object representing the requested field ID on this page.

Examples:
getField()

getParent()

The

is a function on the

FormPage
object that returns the parent
Form
object that this page belongs to. Every form page exists as a page (or tab) inside a larger form.
getParent()
lets you access the whole form from the context of a single page.

Available: Client

JavaScript
Function Signature
getParent() : Form;

Return value: A

object for the parent form of the current

FormPage
.

Examples:
getParent()

getTabType()

The

is a function on the

FormPage
object that returns the type of the tab or page within the form.

The page types that can be returned are as follows, and they will be represented by a character. For example, the page type Action will return A.

Page TypeReturn Value
ActionA
FormF
JoinJ
ListL
GridG

Available: Client

JavaScript
Function Signature
getTabType() : string;

Return value: A string representing the form page type.

Examples:
getTabType()

refresh()

The

is a function on the

FormPage
object that reloads or updates the form page with the latest data. Effectively, ensuring everything is up-to-date on the form page.

The optional parameter gives you control over how much of the form hierarchy gets refreshed, but you don't need to provide it if you only care about the current form page.

Available: Client

JavaScript
Function Signature
refresh([includeParents]) : void;

ParameterTypeDescription
includeParents
booleanOptional: Refresh this form page and all parents in the hierarchy

Return value : void, this function does not return a value back to the caller.

Examples:
refresh()