Forms

(forms)

Overview

The Forms object serves as a scripting entry point to access all forms within a solution at runtime. It enables developers to retrieve form names, manipulate loaded forms, and interact with specific form instances. Accessible via forms.<formName>, it simplifies navigation and operations on forms while supporting code completion.

Key Features

The Forms object provides access to all form names in the current solution, allowing iteration or direct access to forms using their names. Developers can determine the number of forms loaded into memory or interact with a form instance to manage its elements, controller, and variables. It is particularly helpful for dynamic form manipulation and integration with scripting workflows in Servoy applications.

Properties Summarized

Type
Name
Summary

Get a form by name.

Get the number of forms loaded into memory.

Properties Detailed

[name]

Get a form by name.

Type RuntimeForm

Sample

var allForms = solutionModel.getForms();
application.output("There are " + allForms.length + " forms.");
for (var i=0; i<allForms.length; i++)
{
	var f = forms[allForms[i].name];
	application.output("Form " + allForms[i].name + " has selected index " + f.controller.getSelectedIndex());
}

length

Get the number of forms loaded into memory.

Type Number

Sample

application.output("Number of forms loaded into memory: " + forms.length);

Last updated