Expand my Community achievements bar.

SOLVED

how to use Coral UI/multified and data like this?

Avatar

Level 9

so I have the following CQdialog and it gives me something like in the screenshot (see below).

 

Any ideas on how to convert the multified to Coral UI and still get the same data format? Thanks!

2023-07-05 20_13_36.png

<links jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/multifield" fieldLabel="Links Configurations">
    <field jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/fieldset" acs-commons-nested="" name="./links">
        <layout jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns" method="absolute" />
        <items jcr:primaryType="nt:unstructured">
            <column jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/container">
                <items jcr:primaryType="nt:unstructured">
                    <link jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser" fieldDescription="Select Image Path" fieldLabel="Path" name="./link" rootPath="/content" />
                    <link-text jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/textfield" fieldDescription="Enter the link text to display. " fieldLabel="Tile Link Text" name="./linkText" />
                    <targetSelect
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/select"
                        emptyOption="{Boolean}false"
                        emptyText="Select yes or no"
                        fieldLabel="Open in New Window"
                        multiple="{Boolean}false"
                        name="./target"
                    >
                        <items jcr:primaryType="nt:unstructured">
                            <self jcr:primaryType="nt:unstructured" selected="{Boolean}true" text="no" value="_self" />
                            <blank jcr:primaryType="nt:unstructured" text="yes" value="_blank" />
                        </items>
                    </targetSelect>
                </items>
            </column>
        </items>
    </field>
    <typehint jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/hidden" name="./links@TypeHint" value="String[]" />
</links>

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @jayv25585659 

 

In Coral UI 3 the multifield data will de stored individual nodes. It would no more be stored in the above format. I would suggest to write a groovy script to covert existing data into individual data nodes. Please refer the below document.

 

https://aemhints.com/2020/10/24/coral-multifield-aem65/

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @jayv25585659 

 

In Coral UI 3 the multifield data will de stored individual nodes. It would no more be stored in the above format. I would suggest to write a groovy script to covert existing data into individual data nodes. Please refer the below document.

 

https://aemhints.com/2020/10/24/coral-multifield-aem65/

Avatar

Community Advisor

The JSON format was an old and now deprecated implementation, it is recommended to use the Multifield from coral3 which will store the data as nodes, if you really want to stick to the JSON implementation for some reason you will have to write your own, implementation, here are good resources of how to do it:

- https://medium.com/@ramamity94/implement-an-n-level-aem-multifield-using-coral-ui-and-sling-models...

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/multifield-not-storing-val... 

 



Esteban Bustamante