Page History
Columns define what content is displayed in tree and list views in the browser subapp. Here is an example of column configuration in My first content app.
Info |
---|
This column definition is part of the Magnolia 6 UI framework. The fully qualified class name is If you work with the Magnolia 5 UI framework, see Column definition for Magnolia 5 UI instead. |
Table of Contents |
---|
Example column definition
Code Block | ||
---|---|---|
| ||
columns: &columns - name: jcrName label: name $type: jcrTitleColumn nodeTypeToIcon: mgnl:contact: icon-people mgnl:content: icon-folder filterComponent: $type: textField editable: true editor: availability: nodes: true sortable: trueproperties: true - name: value label: value editable: true editor: availability: nodeTypes: mgnl:contact - name: jcrPath propertyNamelabel: jcrNamepath class$type: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinitionjcrPathColumn - name: status label: status $type: jcrStatusColumn - name: mgnl:created $type: dateColumn label: date editable: true editor: availability: nodeTypes: - mgnl:contact width nodes: 45true displayInChooseDialog properties: false field: formatterClass: info.magnolia.ui.workbench.column.StatusColumnFormatter $type: textField class converterClass: infocom.magnoliavaadin.uidata.workbench.column.definition.StatusColumnDefinitionconverter.StringToDateConverter |
Column
...
properties
class | required (unless The column definition class reads the column configuration and displays the column accordingly. The class must implement the the
Javadoc | 0 | See Column types for possible values. | |||||||||||||||||||||||||||
$type | You can use this as a shortcut for | workbench
| definition.AbstractColumnDefinition is the base implementation for all special column definitions.
Javadoc | ||
---|---|---|
|
Javadoc | ||
---|---|---|
|
Javadoc | ||
---|---|---|
|
Javadoc | ||
---|---|---|
|
propertyName
ColumnType
. The proper value is defined by the annotation.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
@ColumnType("dateColumn")
public class DateColumnDefinition extends ConfiguredColumnDefinition<Date> {
...
} |
To use the $type
property in YAML, see Example column definition.
type
required, default is java.lang.String
Model type of the column. Use the fully qualified class name. See PropertyType for possible values.
A default type is typically hard-coded in each definition class. You only need to add this property if you want to override the default implementation (for example, with java.lang.Long
).
name
optional, default is parent node name
Name of the column.
descriptionGenerator
optional
Generates a description for the column.
editable
optional, default is false
When set to true
, the column can be edited inline. You can double-click a cell to edit its value.
You cannot define defaultAction
and use inline editing at the same time.
editor
optional
Defines the inline editor component. For this to work, you have to set editable
to true
. See the
Javadoc resource link | ||
---|---|---|
|
|
Name of the property to display. Needed when using the
Javadoc | ||
---|---|---|
|
editable
optional, default it false
Makes the column editable inline. You can double-click a cell to edit its value.
Inline editing is available only in the tree view, not in list, thumbnail or search views.
Defining a defaultAction
will override inline editing. Double-clicking the cell with trigger the default action instead of inline edit mode.
enabled
optional , default is true
Defines whether the column is displayed in the workbench or not.
expandRatio
optional , default is 1.0
Defines how excess space is divided among columns. A table can have excess space if its width is defined and there is more horizontal space than is occupied by the column data. In a three-column workbench with expand ratios 2
, 2
and 1
, the first column takes 40% of the horizontal space, the second column 40% and the third column 20%.
|
field
required, default is textField
Type of the field definition item. See Field types for possible values.
availability
optional
Outlines when inline editing is permitted. See Action availability for more information.
Availability is resolved against the selected row, not the selected column or property.
expandRatio
optional
Defines the ratio with which the column expands. By default, all columns expand equally.
filterComponent
optional
Adds a filter field to the column. In theory, all field types are supported. See List of fields for more information.
Currently, column filtering is not supported in REST-based elements of the UI.
label
optional
Text displayed in the column heading. The value can be literal or a key of a message bundle.
If you do not provide the property, Magnolia will fall back to a generated i18n key.
maximumWidth
optional
Defines the maximum allowed pixel width of the column when it is set to expand.
minimumWidth
optional
Defines the minimum guaranteed pixel width of the column when it is set to expand.
minimumWidthFromContent
optional, default is true
Sets whether the width of the content in the column is the minimum width of the column. When false
, the column shrinks down to the width defined in minimumWidth
if necessary.
renderer
optional, default is com.vaadin.ui.renderers.TextRenderer
Class extending Vaadin AbstractRenderer
.
valueProvider
optional
Class extending Vaadin ValueProvider
.
width
optional
Defines the width (in pixels). When set, overrides any configuration from expandRatio
, maximumWidth
and minimumWidth
.
Column types
$type | class | |||
---|---|---|---|---|
| formatterClass | optional Defines how the column's value is displayed in the UI. This is useful for making raw data more readable or adhering to a formatting convention. The Contacts app implements a Javadoc | |
Vincent + Van Gogh is displayed as Vincent Van Gogh . Another example is to segment a phone number such as 41612289000 as friendlier +41 61 228 9000 .
|
|
| |||
Javadoc | |
| ||
displayInChooseDialog | optional, default is Display the column in a choose dialog. | |||
label | optional, default is column Text displayed to use in the column heading. Can be the text itself or an 18n key. | |||
name | optional, default is the parent node name Name of the column. | |||
sortable | optional, default is Allows the user to sort the data by clicking the column heading. | |||
| ||||
|
| |||
|
| |||
|
| width |