Page tree
Skip to end of metadata
Go to start of metadata


Make it easier to implement dialogs in Admincentral where the fields can be dynamically changed, based on other fields.

For example make these easy, fast, clear, powerful to implement:


1. Introduce the ability to supply logical expressions which can use the values of other fields in order to determine the state on a field.

Expressions might be javascript, or an expression language like MVEL.

Maybe expressions are indicated by parenthesis.

( isWizard & hasWand)

For example, these properties could use expressions: enabled, visible, required, label, buttonLabel, options

2. Provide ways to augment fields, potentially with Java, that do not require creating brand new fieldTypes. Creating fieldTypes is harder, slower & less transparent then augmenting a fieldType with some custom behaviour.


Is there a nice way that, for any thing that can take an inline expression, it could also take an external javascript function, or a java class?

Would we need to add additional properties like enabledClass, visibleClass....?


User, Group and Role aware

Expressions would also have access to some context such as the current user group and role, so that some fields would only be visible or enabled to certain user roles. 

		fieldType: code
		visible: ( context.hasRole('developer'))  #or something like that!

Dynamically Enabled

The enabled property can take a logical expression as well as a simple boolean value.

		fieldType: checkbox
		type: Boolean
		fieldType: checkbox
		type: Boolean
		fieldType: text
		enabled: ( isBarbarian & isElf )
        description: What type of hat is your elven barbarian wearing?

Dynamically Visible

A field is only visible on a form, if the  "visible" expression evaluates to true.

Could also be called "present" instead of "visible".

		fieldType: text
		visible: ( isBarbarian & isElf )

Dynamically Validated

Expand the regexp validator to be able to operate not just on the current field, but to include values from other fields.

Introduce a new "expression" validator which can take a logical expression, and which can include values from other fields.

By placing at the field level, devs would have control of where validation messages and hilights appear.

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

Dynamic Label & Dynamic Button Labels

Use expression, Javascript or Java, to determine which hardcoded string is displayed, or which i18n key is retrieved.

For example this can be used with a Static field, to provide a label that reacts to things selected in other controls.

"This combination of herbs soothes your mind and promotes concentration".

		fieldType: static
		label: (info....DynamicHerbMessages)

Dynamic Options

Populate the options of a selectbox, set of radiobuttons, twincolumn select or link field (with chooser), 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.

Dynamic Select


A select field which populates based on an optionModel and parametes which can come from other fields


Developer provides a Java class or a Javascript function 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.

Options list is empty until the "optionModelArguments" fields have values.

		fieldType: select
		path: /
		repository: countries

		fieldType: dynamicSelect
			- country										#references 'country' field.
		optionModel: org.dandelion......StatesPerCountry

		fieldType: dynamicSelect
			- state											#references 'state' field.
		optionModel: org.dandelion......PostalCodesPerState

Node Chooser

Out-of-the-box fields based on a heirarchy of nodes. (Probably JCR bound.)

introduce two new dynamic field types:


A link field which gets its workspace from another field.


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

By default it only returns the immediate children.

		fieldType: workspace

	myParentNode:	#lists items based on the workspace chosen in 'myWorkspace' field.
		fieldType: dynamicNodeLink
		workspace: myWorkspace
			- mgnl:folder

    assets:         #lists items based on the node chosen in 'myParentNode' field.
		fieldType: dynamicNodeSelect
		parentNode: myParentNode
        includeAllDecendants: true
			- mgnl:asset

Question: Can we make this ContentType-centric instead of JCR-centric so that it is usable OOTB on external content sources?

REST Item Chooser

Out-of-the-box fields based on a getting items via REST from external content sources.

(Maybe we dont need new field types, we can just leverage what is supplied in EasyREST epic. See comment:  MGNLUI-5020 - Getting issue details... STATUS , but we would need to add the dynamic side.)

introduce two new dynamic field types:


A link field which uses a REST client to populate it's chooser. 

Importantly, the field can use expressions to specify OTHER FIELDS as parameters to the REST client, or as the restClient or the restCall to use, dynamically.


A selectbox which uses a REST client to populate its options.

By default it only returns the immediate children.

Importantly, the field can use expressions to specify OTHER FIELDS as parameters to the REST client, or as the restClient or the restCall to use, dynamically.

		fieldType: select
			- elasticPath
			- shopify

		fieldType: dynamicRESTSelect
            $type: jsonDatasource
            restClient: (ecommerceSystem) #dynamic based on value in 'ecommerceSystem' field.
            restCall: categories

		fieldType: dynamicRESTLink
            $type: jsonDatasource
            restClient: (ecommerceSystem) #dynamic based on value in 'ecommerceSystem' field.
            restCall: products
				- category: (category) #dynamic based on value in 'category' field.

Java Improvements

In addition to the above improvements, we want to make it easier to implement sophisticated use cases in Java.

  • Make fields available to each other in Java - so that customers are not forced to make a composite field anytime they want to program fields that interact with one another.


Take a look at linked tickets on:  MGNLUI-2542 - Getting issue details... STATUS

It would be useful to have a Super-link field where I have a first select box to choose a workspace "tours, pages, contacts", and then a link field below it that lets me choose an item from that workspace.

From:  Dynamic forms and cross-field validation

  • populating select options based on the value of another field
  • validating a field depending on the value of another field (including within a composite field itself)
  • enabling/disabling fields conditionally
  • updating form buttons (enabling/disabling/relabeling)

Filtered Multi Select Choose Dialog

It would be good to ask a support representative:

Maybe Rich or Mercedes.

  • No labels


  1. Nice one, some form of expressions seem to be quite appealing indeed (smile), few more food for thought:

    • seems to work well, especially combined with boolean traits; declaring such attributes "on the spot" reminds me of JSF ELs used in XML-like attributes
    • we could add more such boolean traits (a visible property on fields sounds legit)
    • I would tentatively go for a less technical syntax, e.g. rather with literal AND , OR , NOT EMPTY , etc. We're in a declarative context; that's not backed by a DSL, then users wouldn't be tempted to write arbitrary code, it's not code.
    • re: dynamic labels, using the field abstraction for those was always unfortunate, maybe we can replace that with a description extension to fields
    • and/or with a generic way of describing pattern matching hierarchically in YAML? (that one would serve dependent selects as well)
  2. Hi, this would also be a great improvement for link fields. Common case is that you have Internal, External & DAM Links. It would be great to have such fields based on dynamic forms instead of the wrapping it in an composite field. Composite fields are often not supported by modules like "Translation" or "Live Copy" it is extremly complicated to implement all the if's and else's for all the possible transformerClass .

    Or maybe have a look at my concept Advanced Link field

    I don't know which is better and more flexible.

  3. Very interesting proposal, could be applied for the development of a dynamic form component (smile).

    A suggestion which could be missing is the possibility to execute custom predicates (dynamic behaviour based on business logic).

    How do you plan to integrate this with version 6 fields?