Start page
Start page

Start page / Template development / Template syntax / Data types / IdProvidingFormData

IdProvidingFormData data typeAvailable from FirstSpirit Version 4.2R4

Value range of the IdProvidingFormData data type

Using the input component FS_LIST lists can be entered and maintained. It returns a FormDataList object. This contains IdProvidingFormData objects. IdProvidingFormData serves as connector between

  • a template which is selected by the editor (according to the configuration of FS_LIST: a special, in the project existing section, link or table template),
  • the form fields which are defined in the selected template and
  • the den values which are entered and stored in the form fields by the editor.

For this reason, output of single values can be defined (see 1) below), and output basing on the definition for the output channel of the template (see 2) below).

Single elements of a list are output using a $CMS_FOR(...)$ instruction.

1) Output of single values
On the one hand, you can access the data stored in a single input component of FS_LIST. For this purpose, you must specify the identifier of the input component, e.g.

<ul>
$CMS_FOR(ELEMENT, LIST)$
<li>$CMS_VALUE(ELEMENT.IDENTIFIER)$</li>
$CMS_END_FOR$
</ul>

Here, LIST is the variable name of the FS_LIST component, IDENTIFIER the variable name of the respective input component of the section, link or table template.

The objects will be returned language-dependent by default. For this reason, no language-dependent differentiation is needed.

In addition, you can use the key word fs_id for the DATASOURCE type DATABASE to return the ID of the data records, e.g.

$CMS_FOR(ELEMENT, LIST)$
ID of the data record: $CMS_VALUE(ELEMENT.fs_id)$
$CMS_END_FOR$

Here, LIST is the variable name of the FS_LIST component, ELEMENT one of the data records selected in FS_LIST.

2) Template-based output
On the other hand, you can use the section or link template which is deposited or selected by the editor for the output of the list entries of FS_LIST.

$CMS_FOR(VARIABLE, IDENTIFIER)$
<li>$CMS_VALUE(VARIABLE)$</li>
$CMS_END_FOR$

Here, IDENTIFIER is the variable name of the FS_LIST component. I.e., the output of each element of the list depends on the definition of the output channel of the selected section or link template.

Important Details about the use of FS_LIST, DATASOURCE type INLINE with <TEMPLATES source="sectiontemplates">, in combination with "Easy-Edit" see Chapter Easy-Edit.

3) Outputting the DATASOURCE type PAGE
If you use the DATASOURCE type PAGE you can output the section content by means of the key words uid and label: Use uid to output the name of a section, use label to output the (manually assigned) label, e.g.

<ul>
$CMS_FOR(VARIABLE, LIST)$
<li>
<a href="#$CMS_VALUE(VARIABLE.uid)$">
Label: $CMS_VALUE(VARIABLE.label)$ <br>
UID: $CMS_VALUE(VARIABLE.uid)$</a>
</li>
$CMS_END_FOR$
</ul>

Here, LIST is the identifier of the FS_LIST input component.

The data type IdProvidingFormData can also be looked up in the API documentation:

de.espirit.firstspirit.access.editor.fslist.IdProvidingFormData

Definition using the standard input components

The following standard input component returns an object of data type IdProvidingFormData:

Then, with the help of $CMS_VALUE(...)$ and $CMS_FOR(...)$ instructions, methods can then be applied to the returned objects.

Methods on IdProvidingFormData objects

The table below lists all methods which can be invoked on objects of data type IdProvidingFormData:

The object is generated by the following form objects:
FS_LIST
Method name Return type Brief description Available since
compareTo(Comparable) int
equals(Object) boolean
get(Language, String) FormField Outputting the FormField
getClass Class Class of the invoking object
getForm GomEditorProvider
getId Long
getTemplate Template
isCase(Object) boolean
isNull boolean Checks whether an expression is null (zero)
print void
set(String, Object) Object
toJson String Convert to JSON string representtion (only handles Maps, Collections, Arrays, Numbers, and Strings) 4.2.14
toString String
type String

compareTo(Comparable)

Method name Return type Available since
compareTo(Comparable) int

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)$
Method name Return type Available since
get(Language, String) FormField

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

Method name Return type Available since
getForm GomEditorProvider

getId

Method name Return type Available since
getId Long

getTemplate

Method name Return type Available since
getTemplate Template

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

print

Method name Return type Available since
print void

set(String, Object)

Method name Return type Available since
set(String, Object) Object

toJson

Convert to JSON string representtion (only handles Maps, Collections, Arrays, Numbers, and Strings)
Method name Return type Available since
toJson String 4.2.14

toString

Method name Return type Available since
toString String

type

Method name Return type Available since
type String

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2014-04-10