Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • return true for Transformer.hasI18NSupport() 
  • implement a compatible Magnolia i18n logic.

Default Value

The field default value is defined as String in defaultValue  property in the  ConfiguredFieldDefinition. ConfiguredFieldDefinition.defaultValue  contains the String representation of the default value.

The default value is displayed on the field only showed the first time the related form is displayed.

This behavior is only supported by  basic field

Implemented

Property

...

A ConfiguredField is field needs to be linked to a TransformedProperty<T>

  • TransformedProperty<T>  is initialized with a Transformer.

TransformedProperty<T> extend ObjectProperty<T>.

property as data source. The value of the property is used to store the value entered/selected by the user on the field.
In Magnolia 5.1, every field are bound to a property that support Transformer called TransformedProperty.
This property is initialized with the configured Transformer and set to the field as datasource by the FieldFactory.

 

Mockup
Nameww

A ConfiguredField is linked to a TransformedProperty<T>

  • TransformedProperty<T>  is initialized with a Transformer.

TransformedProperty<T> extend ObjectProperty<T>.

  • value T : Transformer.readFromItem()
  • T : Transformer.
  • value T : Transformer.readFromItem()
  • T : Transformer.getType()

The Transformer has the responsibility to retrieve the initial value and to set the property class type.

TransformedProperty<T>  may be of any type. For a TextField defined configured to handle Long (ConfiguredFieldDefinition.type = Long), the <T>  will be of type Long.
For complexer Field (Multi, Composite) the <T> is of type PropertysetItem . This let the complex field easily handle multi property.

 

 

 

 

 

Implemented Handlers

 

BasicPropertyHandler

Overview

Mockup
Namebasic

Implemented Transformer

BasicTransformer

BasicPropertyHandler

The property linked to a field is retrieved and stored based on the Field's  property name defined in the field definition.
A new property is created in case id does not yet exist.

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue
   
Paragraph

simpleText
Simple English Text
   
Paragraph

simpleText_de
Einfache deutsche Text
   
Paragraph

simpleText_fr
Simple text en francais
OptionGroupPropertyHandler

In case of an OptionGroup field is defined as multiselect, the selected values are stored as a JCR multi-value-property. This JCR multi-value-property is normally handled as a List, but the underlying Vaadin field is only working with Set . This handler simply convert  List to Set

TextCodePropertyHandler

Simple TextCode Handler that return an empty String instead of a null property value.

TwinSelectPropertyHandler

Like for the OptionGroup field, the underlying Vaadin Field need additional convertor between List to Set.

...

CompositeTransformer

In addition to the CompositeField and SwitchableField default Handler, we provide two additional CompositeHandler:

...