Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

granite/ui/components/coral/foundation/form/hidden i snot getting stored in Multifield after Coral 3 migration

Avatar

Level 2

Hi,

 

I am migrating an Accordion component. I have a multifield which has 2 fields

 

1. Question- cq/gui/components/authoring/dialog/richtext

2. id- granite/ui/components/coral/foundation/form/hidden

 

ks_hitijingole_0-1625823631385.png

 

 

Before migration in the component properties both the fields are stored in JSON.

 

ks_hitijingole_1-1625823783284.png

 

 

But after migration I see only question is getting stored in item nodes. 

ks_hitijingole_2-1625823828826.png

 

Any idea why only id is not getting stored after Coral 3 migration?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @ks_hitijingole ,

 

If your Id field is hidden in the dialog using granite/ui/components/coral/foundation/form/hidden resourceType, then how are you authoring the value of id.

 

I feel there should be a listener to increment the value of id on adding each multifield and that is not working on migration.

 

Can you please check how you were incrementing the value.

 

And as now multifield is fetched in the model as list you can either remove id from the dialog and can add the index too in the list of multifield

 

Hope this helps.

 

Thanks

View solution in original post

6 Replies

Avatar

Level 2

Hi @ks_hitijingole :
Could you please try giving "value" property as well to "granite/ui/components/coral/foundation/form/hidden" resource type.
without this property given value will not be saved in JCR.
check this documentation for more info :
https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui...

Avatar

Level 2
@KirtiA After adding value id is getting stored in item nodes. But earlier the id used to increment on it's own whenever a multifield was added. Same isn't happening now. Any idea how can it be implemented in Coral 3.

Avatar

Level 2

Please check if you have any listener written on the dialog field to increment the id based upon the number of field in the multi-field, if yes same you would have to tweak accordingly to make it work with coral 3.
if not you can write a listner to increment the field value.

Avatar

Correct answer by
Employee Advisor

Hi @ks_hitijingole ,

 

If your Id field is hidden in the dialog using granite/ui/components/coral/foundation/form/hidden resourceType, then how are you authoring the value of id.

 

I feel there should be a listener to increment the value of id on adding each multifield and that is not working on migration.

 

Can you please check how you were incrementing the value.

 

And as now multifield is fetched in the model as list you can either remove id from the dialog and can add the index too in the list of multifield

 

Hope this helps.

 

Thanks

Avatar

Level 2
@Bimmi_Soi, After migration I believe the listener was not able to increment the value of ID. So I wrote a custom logic to add id in the Sling Model itself and I was able to achieve the expected behavior.

Avatar

Employee Advisor
Yes, I thought the same. Great the idea worked.