Interface MultiValueFormItem<T extends Component<?>>
- All Known Implementing Classes:
ComboboxItem
,DualListBox
An interface used to display form item component with multiple values.
Such a form item is DualListBox
or ComboboxItem
in multi-select mode.
The interface implements the methods needed for multi-value functionality. See method descriptions for further details.
- Since:
- 4.0
- Author:
- JBStrap
-
Method Summary
Modifier and TypeMethodDescriptionGets additional values from the relation table.Gets the database name of the relation table.Gets the record-relation table join description.Gets the relation table column name where the component’s value is saved to.boolean
Sets if the component can take multiple values.setExtendValues
(String extendValues) This parameter enables you to save additional data to the relation table.setJoinTableName
(String joinTableName) Selected values in form items with multiple values are saved to a relation table.setRecordColumnName
(String recordColumnName) You can use this setting to specify the way the saved record and the record in the relation table are joined.setValueColumnName
(String valueColumnName) Sets the relation table column name where the component value is saved.
If multiple values have been selected in the component, the relation table will also have multiple records.
-
Method Details
-
setJoinTableName
Selected values in form items with multiple values are saved to a relation table. This method sets the name of the relation table. Values are saved to the relation table. Specify the name of the relation table in the database by using the method.- Parameters:
joinTableName
- Table name for the relation table Specify the table name exactly the same way it is used in the database.- Returns:
- Component instance
-
getJoinTableName
String getJoinTableName()Gets the database name of the relation table.- Returns:
- Relation table name or
null
if not specified
-
setRecordColumnName
You can use this setting to specify the way the saved record and the record in the relation table are joined.
To do this, specify the name of the column in the relation table. The record’s primary key is saved to this column. If the record has a composite key, all fields in the composite key must be listed from the relation table, separated with a comma in the same order they are in the key. Specify fields in the same manner they are in the database.
If the relation table and record are not joined using the relation table, the join type must be specified by setting the field name in the relation table and making it equal (use the equals sign “=”) to the record attribute whose value is saved to the specified field.E.g.: column=recordAttributeName. You can use this format to assign multiple values separated with a comma.
- Parameters:
recordColumnName
- Description of the record-relation table join- Returns:
- Component
-
getRecordColumnName
String getRecordColumnName()Gets the record-relation table join description. -
setValueColumnName
Sets the relation table column name where the component value is saved.
If multiple values have been selected in the component, the relation table will also have multiple records. Upon record modification, relation table records are also updated. If the user deletes a value from the component, the corresponding relation table record is also deleted.- Parameters:
valueColumnName
- Relation table column name where the component value is saved to- Returns:
- Component
-
getValueColumnName
String getValueColumnName()Gets the relation table column name where the component’s value is saved to. -
setExtendValues
This parameter enables you to save additional data to the relation table. The parameter assigns a static value to one or more fields in the relation table. Specify the field name in the relation table and a static value, preceded by an equals sign (“=”). (E.g.: column=12 or column=ABC)
If you do not specify a static value, you can use the attribute of a saved record. Instead of a static value, specify the attribute name. E.g.: columnName=${recordAttributeName}. The specified data is saved to every relation table record. Multiple values can also be specified separated with commas.- Parameters:
extendValues
- The extended values to be added to the table- Returns:
- Component
-
getExtendValues
String getExtendValues()Gets additional values from the relation table.- Returns:
- Additional values saved to the relation table or
null
if not specified
-
isMultiselect
boolean isMultiselect()Sets if the component can take multiple values.- Returns:
- If
true
, the component can take multiple values and the user is able to select them Iffalse
, the component can only take a single value.
-