[MGNLUI-6564] DOC: Fix description of how to configure SwitchableTransformer in M6 Created: 15/Feb/21  Updated: 16/Feb/21  Resolved: 16/Feb/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: Šimon Demočko Assignee: Ashraf Khamis
Resolution: Done Votes: 0
Labels: fields, new-UI-framework, new-form
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Epic Link: Migrate apps to new UI framework
Sprint: UI FW 22
Story Points: 1

 Description   

On this page https://docs.magnolia-cms.com/product-docs/Templating/Dialog-definition/Field-definition/Magnolia-6-UI-ports-of-5-UI-field-transformer-classes.html we miss an important configuration step for switchable fields, which caused SUPPORT-12592.

composite.SwitchableTransformer Use info.magnolia.ui.editor.CurrentItemProvider and set propertyNameDecorator to info.magnolia.ui.field.PrefixNameDecorator.
Set the name property for the field part of switcher configuration to match the switchable field's name.

 We also need to fix the example below: 

form:
  properties:
    switchable:
      $type: switchableField
      field:
        name: switchable ## THIS PART WAS MISSING. Needs to be equivalent to M5 switchable's name.
        $type: radioButtonGroupField
        datasource:
          $type: optionListDatasource
          options:
            - name: text
              value: text
            - name: richText
              value: richText
      itemProvider:
        $type: currentItemProvider
      propertyNameDecorator: info.magnolia.ui.field.PrefixNameDecorator
      forms:
        - name: text
          properties:
            text:
              $type: textField
        - name: richText
          properties:
            richText:
              $type: richTextField


 Comments   
Comment by Ashraf Khamis [ 16/Feb/21 ]

Updated the composite.SwitchableTransformer configuration and example definitions at https://docs.magnolia-cms.com/product-docs/Templating/Dialog-definition/Field-definition/Magnolia-6-UI-ports-of-5-UI-field-transformer-classes.html.

Moved a couple of files so they have full URLs consistent with those of their sibling pages and updated nav.adoc to reflect this change.

Reviewed by Šimon.

Generated at Mon Feb 12 09:37:45 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.