Start page / Template development / Template syntax / System objects / #field

#fieldAvailable from FirstSpirit Version 5.0

Important This object is available only within the parameter information of the FS_BUTTON definitions in forms.

The #field object can be used in conjunction with FS_BUTTON instances in forms to obtain content from and information about input components within the form and to process it within scripts, for instance.

#field in this case is used in the XML form within the <PARAMS/> block of an FS_BUTTON definition.

Using this system object, a single input component is called using its variable name (name attribute in the XML definition form of the component):


This call returns the input component called “st_headline” as a FormField type object; using the methods of the object, properties and content of the current element's input component can then be read out.


In this example the #field system object is used to pass the “st_headline” input component to the “clickhandlerscript” script and to use some properties of the component within this script.

<!-- Template form definition -->

<!-- Define a text box with name "st_headline" -->
<CMS_INPUT_TEXT name="st_headline" >
<LANGINFO lang="*" label="Headline" />

<FS_BUTTON name="st_button" onClick="script:clickhandlerscript">
<LANGINFO lang="*" label="Button" />
<!-- Pass the component named "st_headline" as a parameter -->
<PARAM name="form_headline">#field.st_headline</PARAM>

This example defines a text input component called “st_headline”. Within the <PARAMS/> block of the FS_BUTTON definition, this input component is passed as a parameter called form_headline using the #field object.

If the button script is executed, this input component is passed to the script as the form_headline variable, and current attributes and content of the input component can be further processed in the script:

// Script clickhandlerscript

operationAgent = context.requireSpecialist(;
requestOperation = operationAgent.getOperation(de.espirit.firstspirit.ui.operations.RequestOperation.TYPE);

if (form_headline != null) {
"Information about component: " + form_headline.getName() +
", current value: " + form_headline.get() +
", is this a default? " + form_headline.isDefault()

If an input component is passed to a script or a Java class using the #field system object, this is provided using the parameter name (name attribute of the <PARAM/> tag) - in the case of scripts, directly as a variable, and in the case of executable classes, via the Map<String, String> object, which is passed to the execute() methods.

Each input component object is of the de.espirit.firstspirit.forms.FormField<T> type and receives the methods of this interface.

© 2005 - 2023 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2023.10 | Data privacy