Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

coral 2 composite multifield, previous dialogue value are not populating on reopening the dialogue

Avatar

Level 2

Recently we have upgraded from AEM 6.5.9 to AEM 6.5.20. 

Until now all the multifield what is used in our project are "granite/ui/components/foundation/form/multifield", whose content.xml and jcr properties are similar to  following:

xml: 

<general_userFilters

jcr:primaryType="nt:unstructured"

sling:resourceType="granite/ui/components/foundation/form/multifield"

composite="{Boolean}true"

fieldLabel="User Filters">

<field

jcr:primaryType="nt:unstructured"

sling:resourceType="granite/ui/components/foundation/form/fieldset"

acs-commons-nested=""

name="./userFiltersTouch">

<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">

<field1

granite:class="userparenttag"

jcr:primaryType="nt:unstructured"

sling:resourceType="granite/ui/components/foundation/form/select"

id="parentTag"

name="./userParentTag">

<datasource

jcr:primaryType="nt:unstructured"

sling:resourceType="/apps/abcd/components/par/datasource"/>

</field1>

<field2

granite:class="childTag"

jcr:primaryType="nt:unstructured"

sling:resourceType="granite/ui/components/foundation/form/textfield"

fieldLabel="Question"

name="./question"/>

</items>

</column>

</items>

</field>

</general_userFilters>

 

Node structure:

MaheshKPati_0-1716971290115.png

Now the problem after upgrade is, when the dialogue is reopen, the previous data is not reflected and if we save the dialogue values now, the previous data is lost.

To overcome this issue the solution we,ve in mind is to make multifield and its child fields as /coral/foundation, granite/ui/components/coral/foundation/form/multifield.

As the field is composite, the values are now getting stored as nodes item1, item2 etc.... But the earlier data is still not reflecting. All previous data remains intact but of no use.

 

So to overcome this we have written a servlet which converted all previous node properties "userFiltersTouch" to nodes item like:

MaheshKPati_1-1716971714466.png

With this all previous data is restored in the dialogue and it is working as required. Also the rendering logic is changed to update html pages.

 

The query is :

We have lots of projects and pages which is using "granite/ui/components/foundation/form/multifield" where previous dialogue data is not reflected and on saving the dialogue, previous data is overridden with empty fields and data is lost. The multifield structure is intact but with no previous data.

 

How should we proceed with updating the multifield, whose name and fieldset will vary across project and pages. Should we report to ADOBE or go with the customization . If we go with the customization, what will be the best approach?

 

The current servlet which has been written can be made to read multifield name and its fieldset name , so that it will be compatible with other multifield, but here also the work has to be done on individual page and project basis. Lot of rework and rendering logic change.

 

Is there a way we can make change directly at multifield level?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
4 Replies

Avatar

Community Advisor

Hi @MaheshKPati ,

Going with customization or by using  ""granite/ui/components/coral/foundation/form/multifield." will give you advantage of adding multiple type of fields inside one item of multifield like you can add textfield, dropdown, RTE, etc.
Also when you say your data is being lost is mostly because you have updated the value of sling:resourceType from granite/ui/components/foundation/form/multifield" to "granite/ui/components/coral/foundation/form/multifield."
Please check your browser console for any JS error when you open existing multifield after upgrade from AEM 6.5.9 to AEM 6.5.20. 


Thanks
Tarun

Avatar

Level 2

Thanks @TarunKumar  for the reply and information. With same resourceType only, previous dialogue data is not prepopulating, hence the resource type is updated and tested and the behaviour is mentioned above.

We have decided to go with the migration and make all multifield as coral3.

Avatar

Correct answer by
Community Advisor

Avatar

Administrator

@MaheshKPati Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni