You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

DEPRECATED

This twin-column field definition has been deprecated since Magnolia 6.0. It is part of the Magnolia 5 UI framework.

For the updated implementation, see Twin-column field for Magnolia 6 UI instead.

TwinColSelectFieldDefinition renders two boxes side by side. Available items are in the left box and selected items in the right box. To select an item, move it from left to right. 

This control is useful for selecting large sets of items such as group and role memberships. You can find an example in the Security app.

class: info.magnolia.ui.form.field.definition.TwinColSelectFieldDefinition

fieldType: twinColSelect

Twin-column field properties

Simple twin-column field definition.

form:
 tabs:
    - name: tabTags
      label: Tags
      fields:
        - name: tags
          fieldType: twinColSelect
          type: String
          label: Tags
          options:
            - name: news
              label: News
              selected: true
            - name: sports
              label: Sports
              value: sports
            - name: celebrities
              label: Celebrities
              value: celebrities

Node name

Value

 
form


 
tabs


 
tabTags


 
fields


 
tags


 
options


 
news


 
label

News

 
selected

true

 
value

News

 
sports


 
label

Sports

 
value

sports

 
celebrities


 
label

Celebrities

 
value

celebrities

 
fieldType

twinColSelect

 
label

Tags

Unable to render {include} The included page could not be found.

The select, option group and twin-column fields share this general configuration pattern, but they also have their own additional properties.

<field name>

required

Name of the field.

options

optional

Parent node for the selectable options. If not set, the field generates options from the repository path.

<option name>

Name of the option.

value

required

Value saved to the repository when selected.

name

optional, default is the parent node name

Name of the node where the selected value is stored. If not set, the name of the parent node is used.

label

optional

Option label displayed to the user.

iconSrc

optional

Displays an image next to the option. Value is a path to the image.

selected

optional, default is false

Pre-selects the option.

labelProperty

optional, default is label

Reads option labels from a different property. Set to the name of your custom label node.

path

optional

Path to existing options as opposed to defining options in the current definition. Only valid with a field defined in XML.

Alternatively, option definitions can be placed in a YAML file referenced via include.

repository

optional, default is RepositoryConstants.CONFIG

When using a path to existing options, workspace to look in.

sortOptions

optional, default is true

By default, option labels are sorted alphabetically. When false, sorts the options by JCR node order.

comparatorClass

optional, default is info.magnolia.ui.form.field.factory.SelectFieldFactory.DefaultOptionComparator

When sortOptions set to true, sorts the available options.

valueProperty

optional, default is value

Reads option values from a different property. Set to the name of your custom value node.

Properties specific to the twin-column field.

<field name>Name of field.

leftColumnCaption

optional, default is From

Text displayed above the left column. Typically retrieved from a message bundle.

rightColumnCaption

optional, default is To

Text displayed above the right column. Typically retrieved from a message bundle.

Common field properties:

Unable to render {include} The included page could not be found.

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels