FormData data type
Combinations from the form definition and values recorded with this are also described as FormData objects. For example, this comprises all input components of a template including saved values.
Generally, the content of the name variable identifier, which is defined on the form tab of a template (for more information, also see the Forms area), can be output on the template set tab of the same template simply using $CMS_VALUE(...)$ or $CMS_REF(...)$. To output the content of a referenced object (e.g., using FS_REFERENCE), FormData from the object can be used.
FormData objects are therefore returned by various FirstSpirit elements.
From a FormData object, it is possible to use the get(Language, String) method to access the FormField. This involves precisely one input component and the language-dependent content of the FormData object. The identifier of the required input component is specified in the method (within double quotation marks), as is the required language, e.g.,
.get(#global.language, "IDENTIFIER").get
Using the following simplified syntax, it is possible to access the content of a FormField in the language currently being rendered:
.formData.IDENTIFIER
In such cases, IDENTIFIER is the identifier of the input component whose content is to be accessed.
Methods for FormData objects
The tables below list all the methods that can be called for objects of the FormData data type:
equals(Object)
Method name | Return type | Available since |
---|---|---|
equals(Object) | boolean |
get(Language, String)
The .get(Language, String) method can be used to access the FormField in a particular language. This involves precisely one input component and the language-dependent content of the FormData object. The identifier of the required input component is specified in the method (within double quotation marks), as is the required language, e.g.,
$CMS_VALUE(IDENTIFIER.formData.get(#global.language, "IDENTIFIER2").get)$
Using the following simplified syntax, it is possible to access the content of a FormField in the language currently being rendered:
$CMS_VALUE(IDENTIFIER.formData.IDENTIFIER2)$
$CMS_VALUE(IDENTIFIER.formData.get("IDENTIFIER2")$
$CMS_VALUE(IDENTIFIER.formData["IDENTIFIER2"])$
Method name | Return type | Available since |
---|---|---|
get(Language, String) | FormField | 4.2.404 |
getClass
The .getClass() (in Bean syntax: .class) method returns the class of the invoking object (cf. java.lang.Class).
Invocation:
$CMS_VALUE(myString.class)$
$CMS_VALUE(myString.getClass())$
Output:
java.lang.String
Method name | Return type | Available since |
---|---|---|
getClass | Class |
getForm
Provides the form definition.Method name | Return type | Available since |
---|---|---|
getForm | GomEditorProvider | 4.2.404 |
isCase(Object)
Method name | Return type | Available since |
---|---|---|
isCase(Object) | boolean |
isNull
The .isNull() (in Bean syntax: .isNull) method checks whether an expression or object is null , e.g. storeElement.isNull(). In the case of objects with complex values or objects, the object decides when it is null. The data type DomElement for example always contains an empty document, thus it is never null. For this reason, checking an empty DOM editor input component by using the method .isNull() returns the value false, whereas checking the component with .isEmpty() would return the value true.
The method .isNull() returns a Boolean value as the check result. true is the check result if the expression or object is null and false if not.
Method name | Return type | Available since |
---|---|---|
isNull | boolean |
Method name | Return type | Available since |
---|---|---|
void |
set(String, Object)
Method name | Return type | Available since |
---|---|---|
set(String, Object) | Object |
toJSON
Convert to a JSON-compatible string representation including necessary quotes and escaping for immediate use. Handles Maps, Collections, Arrays, Numbers, Strings, Boolean, Date, and JsonElement. A date instance will be converted to an ISO-8601 formatted date string. Any object other than above will be converted using its 'toString()' value.Method name | Return type | Available since |
---|---|---|
toJSON | String | 5.2.11 |
toString
Method name | Return type | Available since |
---|---|---|
toString | String |
type
Method name | Return type | Available since |
---|---|---|
type | String |