CompositeFieldDefinition renders a complex field that display a composition of fields based on standard field definition.

Class: info.magnolia.ui.form.field.definition.CompositeFieldDefinition

Here is an example coming from the sample dialog show room module.

Node nameValue

 
configuredComposite

 

  
 
fields
(individual field definition)
     
 
name
 
        
 
class
info.magnolia.ui.form.field.definition.TextFieldDefinition
        
 
label
dialog.devShow.allControls.tabLayout.simpleSwitch.fields.text.label
        
 
type
String
     
 
level
 
     
 
link
 
 
class
info.magnolia.ui.form.field.definition.CompositeFieldDefinition
 
label
dialog.devShow.allControls.tabLayout.configuredComposite.label

Storing strategy

By default the transformerClass is set to CompositeTransformer.

Assume that your CompositeField is called 'composite' and contains two fields: a text field called 'simpleText' and a date field called 'simpleDate'. The  values will be stored as following:

Node nameValue
 
compositesimpleText
some text value
 
compositesimpleDate
2006-05-01T21:47:58.230+02:00

 

Configuration

You can use all common field properties and the following:

PropertyDescriptionDefault value
fields
Parent node containing the single field that composed the composite field. 
   field1Parent node of one field composing the composite field. 
     classClass definition of the field1 
     ...
Continue with field1 definition 
   ...Add any number of field definition that should composed the composite field. 
classCompositeFieldDefinition class name. Mandatory.
transformerClassCustom Transformer definition. Optional. 
layoutDefine the field  layout. Layout of the fields could be
vertical  or horizontal . Optional.
horizontal

 


 

 

  • No labels

1 Comment

  1. The description property of child fields is ignored. Same for defaultValue