Closed RaoulBivolaru closed 7 months ago
Are you using the latest generic multifield version 3.1.0?
Yes
From what I can see, the issue is coming from this line: https://github.com/namics/aem-generic-multifield/blob/6.5/master/src/main/resources/SLING-INF/apps/namics/genericmultifield/clientlibs/js/GenericMultifieldDialogHandler.js#L223
I tested without calling _restoreDialogData and everything is working fine. What is the purpose of this method?
When opening a new dialog, the parent dialog is closed and placed on a stack. When the newly opened dialog is closed again, this method retrieves the parent dialog from the stack and displays it. I will try to reproduce the error when I have time.
I will try to reproduce the error when I have time.
Maybe there's a conflict with the "items" name.
Can you specify something else in the generic multifield for itemStorageNode and name. e.g. itemStorageNode="teasers", name="./teasers".
Or alternatively, for the multifield instead of <items>
use <teaseritems>
:
<teaserpages
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true
fieldLabel="Teaser Pages">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./pages">
<teaseritems
jcr:primaryType="nt:unstructured">
<left
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"
name="./linkUrl"
rootPath="/content"/>
</teaseritems>
</field>
</teaserpages>
Tested both solutions and I still have the same problem.
I think _restoreDialogData is redundant. https://github.com/namics/aem-generic-multifield/blob/6.5/master/src/main/resources/SLING-INF/apps/namics/genericmultifield/clientlibs/js/GenericMultifieldDialogHandler.js#L190 is taking care of closing the current dialog and opening parent dialog.
No, it's not redundant. If the method is not called, the data previously entered in the parent dialog disappears as soon as the multifield dialog is closed.
Hey guys i am facing a similiar issue, if i modify anything on genericmultifield it removes data of granitemultifield anyone facing it?
I'm having an issue when I try to use genericmultifield and granite/ui/components/coral/foundation/form/multifield in the same dialog.
When I edit an item from genericmultifield and if I have a granite multifield in the same dialog, the fields from granite multifield gets updated with a new value for the name;
Below you can see the field name before updating an item:
And here you can see it after editing an item
The field path is updated from:
./pages/item0/./linkUrl
to./pages/item0/./pages/item0/./linkUrl
My code:
I'm using AEM version 6.5.4.