Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-7081

Provide the appropriate context for complex attributes in FieldLayoutComponent

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Won't Do
    • Icon: Neutral Neutral
    • None
    • None
    • None
    • None

      The current FieldLayoutComponent interface mainly provides this method:

      void init(EditorPropertyDefinition var1, Component var2); 

      This allows to the implementation class to know the affected property. Moreover, through valueContext.get it is also possible to know the main component. For instance, in this example:

      form:
        properties:
          name:
            label: name
            $type: textField
          multi:
            label: multi
            i18n: true
            $type: jcrMultiField
            itemProvider:
              $type: currentItemProvider
            field:
              $type: compositeField
              properties:
                uno:
                  label: uno
                  $type: textField
                dos:
                  label: dos
                  i18n: true
                  $type: textField
                tres:
                  label: tres
                  $type: textField 

      a component implementing FieldLayoutComponent (e.g. ProtectFieldButton) will be created for the following properties: name, multi. Moreover, for each row created in the multi component, a new component will be created for the properties: uno, dos and tres. So if in multi we have 2 rows, 8 components will be created.

      Unfortunately, the UI framework has a limitation so it is not possible to know the real node for complex attributes. For instance, for the previous component, we could have in JCR:

      Then, when the component is created for uno property, it is not possible to know whether it belongs to multi0 or multi1. This limitation prevents implementing LIVECOPY-159.

      We would need some way to link the created component with the real node the property belongs to.

        Acceptance criteria

          1. image.png
            image.png
            147 kB
          2. image (12).png
            image (12).png
            147 kB

              sang.ngo Sang Ngo Huu
              jalonso Jesus Alonso
              Nucleus
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 1.5d
                  1.5d