granite/ui/components/coral/foundation/form/hidden i snot getting stored in Multifield after Coral 3 migration | Community
Skip to main content
Level 2
July 9, 2021
Solved

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

  • July 9, 2021
  • 2 replies
  • 5396 views

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

 

 

 

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

 

 

 

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

 

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by BimmiSo

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

2 replies

Level 2
July 9, 2021

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/api/jcr_root/libs/granite/ui/components/coral/foundation/form/hidden/index.html

Level 2
July 9, 2021
@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.
BimmiSoAdobe EmployeeAccepted solution
Adobe Employee
July 12, 2021

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

Level 2
July 12, 2021
@bimmiso, 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.