Start page
Start page

Start page / Template development / Forms / Input components / COMBOBOX

CMS_INPUT_COMBOBOX

Contents
for example
to the methods: Option

CMS_INPUT_COMBOBOX

The ComboBox is a complex selection element. ComboBoxes are dropdown boxes which enable the editor to select precisely one entry from a pre-defined quantity of entries and therefore fulfil the same purpose as radiobuttons. Unlike radiobuttons, ComboBoxes can be configured so that editors can also enter their own contents in the ComboBox.

ComboBoxes are particularly suitable if a selection is to be made from many entries as only one entry - the selected one - is displayed here. Specifying more than four selection options by means of a radiobutton on the other hand can quickly become unclear.

This input component can be used within the page or section templates for queries, which trigger different actions depending on the selection.

The CheckBox selection component should be used instead of the ComboBox for multiple selection options.

In addition, if used in the Content Store with the general CMS_INCLUDE_OPTIONS tag, database contents can be displayed in the input component.

Access-API example use case
The exemplary implementation ComboboxEditorValueExample shows some simple examples of use for the reading, writing and creating access to the data object (ComboboxEditorValue) and its inner data container (OptionModel) of the input component by means of the FirstSpirit Access-API.

name
Designator
Mandatory
allowEmpty
YesNo
Optional parameters
convertEntities
ConvertEntity
Optional parameters
editable
YesNo
Optional parameters
hFill
YesNo
Optional parameters
hidden
YesNo
Optional parameters
length
PositiveInteger
Optional parameters
noBreak
YesNo
Optional parameters
preset
Preset
Optional parameters
singleLine
YesNo
Optional parameters
sortOrder
SortOrder
Optional parameters
useLanguages
YesNo
Optional parameters
value
String
Mandatory
lang
LanguageAbbreviation
Mandatory
description
String
Optional parameters
ignore
YesNo
Optional parameters
label
String
Optional parameters
lang
LanguageAbbreviation
Mandatory
description
String
Optional parameters
label
String
Optional parameters

Parameter

The following table gives the parameters of the COMBOBOX input component.

ParameterMandatorySinceTypeDefault value
name*Yes3.1DesignatorNone
allowEmptyNo3.0YesNoYES
convertEntitiesNo2.0ConvertEntityNONE
editableNo3.1YesNoNO
hFillNo2.0YesNoNO
hiddenNo4.0.44YesNoNO
lengthNo4.0PositiveInteger20
noBreakNo2.0YesNoNO
presetNo4.0PresetDEFAULT
singleLineNo4.0YesNoYES
sortOrderNo3.0SortOrderKEEP_ORDER
useLanguagesNo2.0YesNoYES

name

The attribute "name" is the variable name of an input component with which the the result object of the input component can be used in the templates - with the help of $CMS_VALUE()$ - or the content can be output.

ParameterMandatorySinceTypeDefault value
name*Yes3.1DesignatorNone

allowEmpty

The "allowEmpty" parameter is used to specify whether a value has to be entered for an input value or not.

If allowEmpty="YES" input is not mandatory; however, it is if allowEmpty="NO".

Input components with allowEmpty="NO" are also called mandatory input components.

The default value for allowEmpty is YES.

ParameterMandatorySinceTypeDefault value
allowEmptyNo3.0YesNoYES

convertEntities

The "convertEntities" attribute is used to convert special characters entered in the input components for output in HTML characters.

There are three forms:

  • convertEntities="NONE" (standard)
  • convertEntities="STANDARD"
  • convertEntities="QUOTE"

With the NONE form, no conversion rules whatsoever are applied.

If STANDARD is given the conversion rules in the "convert" area of the selected conversion rule of the presentation channel are applied.

The form QUOTE explicitly includes STANDARD too. However, the "quote" area of the conversion rule is also applied.

ParameterMandatorySinceTypeDefault value
convertEntitiesNo2.0ConvertEntityNONE

editable

The editable parameter can be used to specify whether, in addition to the selection of an entry from the range of available entries, individual values can be entered into the input component.

If YES (...editable="YES"...) is specified, entering an individual value into the selection field of the input component is possible as well as the selection from the entries, pre-defined by the tags ENTRIES / ENTRY. This manually entered value will be saved in the input component. However, this value will be only available in the respective input component, not in others. If instead of a manually entered and saved value (e.g. entry) another value is entered into the input component, a pre-defined entry is selected or the content of the input component is deleted by using the icon X, the value entry will be no more available and must be entered anew if required.

Unlike in the case of editable="NO", the values defined by means of the parameter value are used for visualising the selectable entries when setting editable="YES". If editable="NO" is set, the values defined by means of the parameter label will be used.

If the parameter is omitted (or editable="NO") only the entries, pre-defined by ENTRIES / ENTRY can be selected. No individual values can be entered.

ParameterMandatorySinceTypeDefault value
editableNo3.1YesNoNO

hFill

An input component is always displayed with a pre-defined width.

However, if the input component is to use the full available display width the parameter hFill must be given with the value YES .

ParameterMandatorySinceTypeDefault value
hFillNo2.0YesNoNO

hidden

With the "hidden" parameter an input component can be hidden from the editor.

If hidden="YES" the input component is not visible for the editor, if hidden="NO" it is visible.

The default value for hidden is NO.

ParameterMandatorySinceTypeDefault value
hiddenNo4.0.44YesNoNO

length

The length parameter can be used to specify the display width of the input component in characters.

The parameter expects an integer value.

If the parameter is not given the default value is 20.

Important The parameter does not have any effect if the hFill parameter is used.

ParameterMandatorySinceTypeDefault value
lengthNo4.0PositiveInteger20

noBreak

The noBreak parameter can be used to suppress automatic line break after an input component.

The noBreak parameter must be given with value "YES" (noBreak="YES") to suppress the automatic line break.

ParameterMandatorySinceTypeDefault value
noBreakNo2.0YesNoNO

preset

Using the preset attribute the handling of default values in an input component can defined (see also chapter Default values). If preset="default" is set, the fall-back value defined in the form is used. If this value in the form is changed later on, these changes will be affect all usages of this default value in the input components maintained by the editor, as long as a value will be set manually in the input component. This is the default setting. If preset="copy" is set, the value entered by the editor is copied directly into the input component. Subsequent changes to the default value in the form do not have any effect on the usages of this default value in the input components maintained by the editor.

ParameterMandatorySinceTypeDefault value
presetNo4.0PresetDEFAULT

singleLine

The singleLine parameter can be used to specify whether an input component is to be displayed in one row (without frame) or not.

If the parameter is not given the input component is displayed in one row - without a frame.

If NO (...singleLine="NO"...) is specified the input component is displayed over two rows with a frame.

To ensure uniform layout of the input components it is advisable to enter the following for the input components which support this attribute (e.g. COMBOBOX, DATE, NUMBER, TEXT and TOGGLE) singleLine="NO".

ParameterMandatorySinceTypeDefault value
singleLineNo4.0YesNoYES

sortOrder

The sortOrder parameter controls the display order of the entries.

Three keywords can be used with this parameter:

  • sortOrder="KEEP_ORDER" (default)
  • sortOrder="ASCENDING"
  • sortOrder="DESCENDING"

By default or if KEEP_ORDER is selected, the entries will be displayed in the order as defined in the form by the template developer using ENTRIES/ENTRY.

If the ASCENDING or DESCENDING values are selected, the entries are sorted alphabetically from A-Z or from Z-A accordingly. This type of sorting is particularly useful if the entries originate from a linked table (using CMS_INCLUDE_OPTIONS, type DATABASE).

ParameterMandatorySinceTypeDefault value
sortOrderNo3.0SortOrderKEEP_ORDER

useLanguages

The useLanguages parameter can be used to specify whether or not an input component is to store different or deviating values for different languages (multi-lingual maintenance).

If the parameter is not given, deviating values are stored for the different languages as a default.

If NO (...useLanguages="NO") is specified, one value is stored for all languages.

ParameterMandatorySinceTypeDefault value
useLanguagesNo2.0YesNoYES

ENTRIESAvailable from FirstSpirit Version 4.0

The ENTRIES tag can be used to specify the quantity of entries available for selection in the input component.

The ENTRY tag can be given in the tag.

A selectable entry corresponds to an ENTRY tag.

ENTRYAvailable from FirstSpirit Version 3.0

An ENTRY tag is used to precisely define a format template within the ENTRIES tag, which is to be available for selection in the input component. The tag has the mandatory parameter value, which corresponds to the value to be stored in the input component.

ParameterMandatorySinceTypeDefault value
value*Yes2.0StringNone

value

The value parameter in the ENTRY tag is used to specify the value to be stored in the input component.

Important The individual values of the value parameters within an ENTRIES tag must be different from each other.

ParameterMandatorySinceTypeDefault value
value*Yes2.0StringNone

LANGINFOSAvailable from FirstSpirit Version 3.1

Using the tag LANGINFOS language-dependent information can be defined for each input component, e.g. which title is to be used for the input component in the different project languages (parameter label), which tooltip is to be displayed (parameter description) etc. For reasons of clarity, definitions which are identical in multiple languages will be merged. For example,

<LANGINFOS> 
<LANGINFO lang="*" label="Datum"/>
<LANGINFO lang="DE" label="Datum"/>
<LANGINFO lang="EN" label="Datum"/>
</LANGINFOS>

will be merged to

 <LANGINFOS> 
<LANGINFO lang="*" label="Datum"/>
</LANGINFOS>

after saving.

Available from FirstSpirit Version 4.2R2 Up to and including FirstSpirit version 4.2R2 language definitions will be deleted only in the case if the values are identical in all languages (as in example above). Furthermore, only the parameters lang, description and label are taken into account when merging.

Available from FirstSpirit Version 4.2R4 Since FirstSpirit version 4.2R4 all parameters are taken into account (e.g. format and length). Furthermore, language definitions are also merged within LANGINFOS tags, if they are identical in at least two languages. For example,

<LANGINFOS> 
<LANGINFO lang="*" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="DE" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="EN" label="Date" format="MM/dd/yy"/>
</LANGINFOS>

will become

 <LANGINFOS> 
<LANGINFO lang="*" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="EN" label="Date" format="MM/dd/yy"/>
</LANGINFOS>

after saving.

The definition for the fallback value (*) will not be deleted in any case. If there are two or more language definitions with identical values the first one will be maintained, the other will be deleted.

Available from FirstSpirit Version 4.2R2 IMPORTANT: Up to and including FirstSpirit version 4.2R2 at least one definition for the fallback labelling ("*") must be given:

<LANGINFOS>
<LANGINFO lang="*" label="TEXT"/>
</LANGINFOS>

Available from FirstSpirit Version 4.2R4 From FirstSpirit version 4.2R4 the fallback definition can be omitted. In this case, the language which is defined first will be used automatically as fallback value. For example,

<LANGINFOS>
<LANGINFO lang="EN" label="Date"/>
<LANGINFO lang="DE" label="Datum"/>
</LANGINFOS>

will become

 <LANGINFOS> 
<LANGINFO lang="*" label="Date"/>
<LANGINFO lang="DE" label="Datum"/>
</LANGINFOS>

after saving.

LANGINFOAvailable from FirstSpirit Version 3.1

The LANGINFO tag is used to give values or attributes for a language as well for use as fallback values.

In order to state values or attributes for a language it is necessary to give the abbreviation of the project language in the lang parameter:

...
<LANGINFO lang="DE".../>
...

Fallback values are given with the special language abbreviation * ("for all languages"):

...
<LANGINFO lang="*".../>
...

The lang parameter is a mandatory parameter.

ParameterMandatorySinceTypeDefault value
lang*Yes3.1LanguageAbbreviationNone
descriptionNo3.1StringNone
ignoreNo4.0YesNoNO
labelNo3.1StringNone

lang

The lang parameter is used to give the language abbreviation which is entered in the server properties see View document, Chapter "Language templates") to specify for which project languages the definitions are to apply, e.g. DE for German, EN for English, FR for French etc. The following characters can be used as often as required: -, _, 0-9 and A-Z. Lower case letters are transformed automatically into upper case letters after having saved the template. In addition * can be used for fallback values.

ParameterMandatorySinceTypeDefault value
lang*Yes3.1LanguageAbbreviationNone

description

The description parameter can be used to give a description which is used to display a tool tip (mouse-over).

ParameterMandatorySinceTypeDefault value
descriptionNo3.1StringNone

ignore

The ignore parameter can be used so that the entry is not displayed or is ignored in the given language.

If the parameter is not given an entry is displayed in the language.

If YES (...ignore="YES") is specified the corresponding entry in the given language is ignored.

ParameterMandatorySinceTypeDefault value
ignoreNo4.0YesNoNO

label

The label parameter is used to give the surface labelling for input and visualisation components.

ParameterMandatorySinceTypeDefault value
labelNo3.1StringNone

LANGINFOSAvailable from FirstSpirit Version 4.0

Using the tag LANGINFOS language-dependent information can be defined for each input component, e.g. which title is to be used for the input component in the different project languages (parameter label), which tooltip is to be displayed (parameter description) etc. For reasons of clarity, definitions which are identical in multiple languages will be merged. For example,

<LANGINFOS> 
<LANGINFO lang="*" label="Datum"/>
<LANGINFO lang="DE" label="Datum"/>
<LANGINFO lang="EN" label="Datum"/>
</LANGINFOS>

will be merged to

 <LANGINFOS> 
<LANGINFO lang="*" label="Datum"/>
</LANGINFOS>

after saving.

Available from FirstSpirit Version 4.2R2 Up to and including FirstSpirit version 4.2R2 language definitions will be deleted only in the case if the values are identical in all languages (as in example above). Furthermore, only the parameters lang, description and label are taken into account when merging.

Available from FirstSpirit Version 4.2R4 Since FirstSpirit version 4.2R4 all parameters are taken into account (e.g. format and length). Furthermore, language definitions are also merged within LANGINFOS tags, if they are identical in at least two languages. For example,

<LANGINFOS> 
<LANGINFO lang="*" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="DE" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="EN" label="Date" format="MM/dd/yy"/>
</LANGINFOS>

will become

 <LANGINFOS> 
<LANGINFO lang="*" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="EN" label="Date" format="MM/dd/yy"/>
</LANGINFOS>

after saving.

The definition for the fallback value (*) will not be deleted in any case. If there are two or more language definitions with identical values the first one will be maintained, the other will be deleted.

Available from FirstSpirit Version 4.2R2 IMPORTANT: Up to and including FirstSpirit version 4.2R2 at least one definition for the fallback labelling ("*") must be given:

<LANGINFOS>
<LANGINFO lang="*" label="TEXT"/>
</LANGINFOS>

Available from FirstSpirit Version 4.2R4 From FirstSpirit version 4.2R4 the fallback definition can be omitted. In this case, the language which is defined first will be used automatically as fallback value. For example,

<LANGINFOS>
<LANGINFO lang="EN" label="Date"/>
<LANGINFO lang="DE" label="Datum"/>
</LANGINFOS>

will become

 <LANGINFOS> 
<LANGINFO lang="*" label="Date"/>
<LANGINFO lang="DE" label="Datum"/>
</LANGINFOS>

after saving.

LANGINFOAvailable from FirstSpirit Version 3.1

The LANGINFO tag is used to give values or attributes for a language as well for use as fallback values.

In order to state values or attributes for a language it is necessary to give the abbreviation of the project language in the lang parameter:

...
<LANGINFO lang="DE".../>
...

Fallback values are given with the special language abbreviation * ("for all languages"):

...
<LANGINFO lang="*".../>
...

The lang parameter is a mandatory parameter.

ParameterMandatorySinceTypeDefault value
lang*Yes3.1LanguageAbbreviationNone
descriptionNo3.1StringNone
labelNo3.1StringNone

lang

The lang parameter is used to give the language abbreviation which is entered in the server properties see View document, Chapter "Language templates") to specify for which project languages the definitions are to apply, e.g. DE for German, EN for English, FR for French etc. The following characters can be used as often as required: -, _, 0-9 and A-Z. Lower case letters are transformed automatically into upper case letters after having saved the template. In addition * can be used for fallback values.

ParameterMandatorySinceTypeDefault value
lang*Yes3.1LanguageAbbreviationNone

description

The description parameter can be used to give a description which is used to display a tool tip (mouse-over).

ParameterMandatorySinceTypeDefault value
descriptionNo3.1StringNone

label

The label parameter is used to give the surface labelling for input and visualisation components.

ParameterMandatorySinceTypeDefault value
labelNo3.1StringNone
Key

LanguageAbbreviation

Language abbreviation, e.g. DE, EN, FR or * for return values

PositiveInteger

Positive integer

YesNo

Switch to apply an attribute or not

NOAvailable from FirstSpirit Version 2.0

Do not apply attribute

YESAvailable from FirstSpirit Version 2.0

Apply attribute

String

A random character string

SortOrder

Switch with which to define the sort order of the entries

KEEP_ORDERAvailable from FirstSpirit Version 3.0

Retain the sort order of the entries

ASCENDINGAvailable from FirstSpirit Version 3.0

Sort entries alphabetically in ascending order

DESCENDINGAvailable from FirstSpirit Version 3.0

Sort entries alphabetically in descending order

Preset

How to deal with default values

CopyAvailable from FirstSpirit Version 4.0

The value entered by the editor is copied directly into the input component, subsequent changes do not have any effect

DefaultAvailable from FirstSpirit Version 4.0

The fall-back value defined in the form is used, as long as a value will be set manually

ConvertEntity

Switch with which to define the conversion rule

NONEAvailable from FirstSpirit Version 2.0

Do not use any conversion rules

STANDARDAvailable from FirstSpirit Version 2.0

Use the conversion rules of the "convert" area

QUOTEAvailable from FirstSpirit Version 2.1

Use the conversion rules of the "convert" and "quote" area

Designator

Unique identifier of variable length; must start with a letter or underscore and may only contain the characters "A-Z", "a-z", "0-9" and "_", e.g. "fr_st_varName"

Example

An example of the input component "CMS_INPUT_COMBOBOX":

<CMS_INPUT_COMBOBOX name="IDENTIFIER" useLanguages="YES">
<ENTRIES>
<ENTRY value="VALUE">
<LANGINFOS>
<LANGINFO lang="*" label="TEXT"/>
<LANGINFO lang="DE" label="TEXT"/>
<LANGINFO lang="EN" label="TEXT"/>
</LANGINFOS>
</ENTRY>
</ENTRIES>
<LANGINFOS>
<LANGINFO lang="*" label="TEXT" description="TEXT"/>
<LANGINFO lang="DE" label="TEXT" description="TEXT"/>
<LANGINFO lang="EN" label="TEXT" description="TEXT"/>
</LANGINFOS>
</CMS_INPUT_COMBOBOX>

An example of the filling of a "CMS_INPUT_COMBOBOX" input component with entries from an external table (Content Store):

<CMS_INPUT_COMBOBOX name="IDENTIFIER" useLanguages="NO">
<CMS_INCLUDE_OPTIONS type="database">
<LABELS>
<LABEL lang="*">#item.COLUMN</LABEL>
<LABEL lang="DE">#item.COLUMN_DE</LABEL>
<LABEL lang="EN">#item.COLUMN_EN</LABEL>
</LABELS>
<TABLE>TABLETEMPLATE</TABLE>
</CMS_INCLUDE_OPTIONS>
<LANGINFOS>
<LANGINFO lang="*" label="TEXT" description="TEXT"/>
<LANGINFO lang="DE" label="TEXT" description="TEXT"/>
<LANGINFO lang="EN" label="TEXT" description="TEXT"/>
</LANGINFOS>
</CMS_INPUT_COMBOBOX>

Example of use in the template syntax

As a COMBOBOX input component returns an Option object the value selected by the editor can be output with the .getValue() method.

The call for a COMBOBOX input component with the identifier st_combobox is:

$CMS_VALUE(st_combobox.value)$

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