bobcat icon indicating copy to clipboard operation
bobcat copied to clipboard

How to configure a multifield inside a multifield ?

Open crisandani opened this issue 5 years ago • 1 comments

Environment

Bobcat version:

Bobcat modules used:

  • bb-aem-core
  • bb-aem-65
  • bb-core
  • bb-junit5

Browser + version: Chrome 81

I have problems configuring a component that contains a multifield in another multifield

Expected Behavior

Create 3 items of first multifield and complete them with the data from .yaml file

Actual Behavior

Create 1 item of first multifield and complete them with the data from .yaml file . Create 2 items of second multifield and crashes the test

Steps to reproduce

This is the Yaml file:

Tab:
  - label: 'Multifield1'
    type: MULTIFIELD
    value:
    - item:
      - type: PATHBROWSER
        label:  'Image'
        value: '/content/dam/folder/Asset.png'
      - type: TEXTFIELD
        label:  'Heading'
        value: 'Create your own template'
      - type: RICHTEXT
        label:  'Description'
        value: 'value'

    - item:
      - type: PATHBROWSER
        label:  'Image'
        value: '/content/dam/folder/Asset.png'
      - type: TEXTFIELD
        label:  'Heading'
        value: 'Automatic Backup Data'
      - type: RICHTEXT
        label:  'Description'
        value: 'value' 

    - item:
      - type: PATHBROWSER
        label:  'Image'
        value: '/content/dam/folder/Asset.png'
      - type: TEXTFIELD
        label:  'Heading'
        value: 'Page Builder'
      - type: RICHTEXT
        label:  'Description'
        value: 'value'

And this is cq_dialog File:

<multifield1
        jcr:primaryType="nt:unstructured"
        jcr:title="Multifield1"
	fieldLabel="Multifield1"
        ling:resourceType="granite/ui/components/coral/foundation/form/multifield"
        composite="{Boolean}true">
        <field
		jcr:primaryType="nt:unstructured"
		sling:resourceType="granite/ui/components/coral/foundation/container"
                name="./multifield1Items">
            <items jcr:primaryType="nt:unstructured">
                <image
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                        class="cq-droptarget"
                        fieldLabel="Image"
                        required="{Boolean}false"
                        rootPath="/content/dam/"
                        fieldDescription="Drag and drop an image asset from the asset finder here."
                        name="./imagePath"/>
		<heading
			jcr:primaryType="nt:unstructured"
			sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
			fieldLabel="Heading"
			name="./heading"/>
		<text
			jcr:primaryType="nt:unstructured"
			sling:resourceType="cq/gui/components/authoring/dialog/richtext"
			fieldLabel="Description"
			name="./description"
			useFixedInlineToolbar="{Boolean}true">
			//more richText settings
		</text>
		<multifield2
			jcr:primaryType="nt:unstructured"
			jcr:title="Multifield2"
			sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
			composite="{Boolean}true">
			<field
				jcr:primaryType="nt:unstructured"
				sling:resourceType="granite/ui/components/coral/foundation/container"
				name="./multifield2Items">
				<items jcr:primaryType="nt:unstructured">
					<check
						jcr:primaryType="nt:unstructured"
						sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
						fieldLabel="Check List"
						name="./check"/>
				</items>
			</field>
		</multifield2>
            </items>
        </field>
</multifield1>

crisandani avatar May 08 '20 09:05 crisandani

I think the configuration hierarchy of the .yaml file doesn't work well. I have a RICHTEXT field before multifield and another in multifield. For the RICHTEXT field inside the multifield I set a value but change the one before the multifield.

crisandani avatar May 08 '20 10:05 crisandani