Versions Compared

Key

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

...

Code Block
fields:
	clericSpells:
		fieldType: text
		validators:
            onlyClericOrWizard
              class: info....ExpressionValidator
              expression: (!(clericSpells!="" & wizardSpells!=""))
			  errorMessage: Only Cleric OR Wizard spells allowed, not both.


Dynamic Options

Populate the options of a selectbox, set of radiobuttons, or twincolumn select, based on the value of other fields.

We provide some out-of-the-box modes where no custom coding is required, but also make it easier for developers to fulfil this use case with a minimum of coding for more custom use cases.


optionModel Class

Developer provides a Java class or a JS class which takes the values of the fields specifed in "optionModelArguments" as arguments, and returns an array of label & value pairs to populate the options field with.

Code Block
fields:
	heroType:
		fieldType: select
		options:
			- wizard
			- cleric
			- fighter
			- thief
	level:
		fieldType: select
		options:
			- 1
			- 2
			- 3
			- 4

    spells:
		fieldType: dynamicOptions
		optionModelArguments
			- heroType
			- level
		optionModel: org.dandelion......AvailableSpells
        description: Choose from your available spells, after choosing your heroType and level.


Node Chooser

Out-of-the-box field based on a heirarchy of nodes. (Not necessarily JCR bound.)

introduce two new dynamic field types:

dynamicLink: A link field which gets its workspace from another field.

dynamicNodeOptions: A selectbox which gets its options based on a parentNode from another field.

Code Block
fields:
	myWorkspace:
		fieldType: workspace

	myParentNode:
		fieldType: dynamicLink
		workspace: myWorkspace
		nodeTypes:
			- mgnl:folder

    assets:
		fieldType: dynamicNodeOptions
		parentNode: myParentNode
        includeAllDecendants: true




Notes

Take a look at linked tickets on: 

Jira
serverMagnolia - Issue tracker
serverId500b06a6-e204-3125-b989-2d75b973d05f
keyMGNLUI-2542

...