Hi, I am struggling with how to use cq/gui/components/authoring/dialog/fileupload in a granite/ui/components/coral/foundation/form/multifield.
I have read the many questions where the topic was discussed, but was wondering if anyone would be kind enough to provide a working sample (for future reference as well) of a functioning cq/gui/components/authoring/dialog/fileupload in a granite/ui/components/coral/foundation/form/multifield.
One of my failed attempts (bareboned to be more concise) looks like this:
The issue is that, when I submit the dialog, the fileReference values are saved as an array of String on the main component's node, while I'd like them to be stored each one on a different item property (es. item0, item1, item2, etc.)
If instead of using cq/gui/components/authoring/dialog/fileupload, I switch to granite/ui/components/coral/foundation/form/pathfield, everything works like a charm, and the item0,item1,itemN nodes are created, each one with its own fileReference property.
This is, more or less, what's on the JCR (you can assume valid properties and nodes where there is a black box):
Unfortunately, granite/ui/components/coral/foundation/form/pathfield cannot be used with drag&drop, and my requirement is to allow the drag&drop of images from the DAM.
So, again, I don't know if somebody can shed some light on the issue and ideally provide a working example to be used as a starting point, but I'll be immensly grateful (as always) for any help you'll be able to provide.
As a final note, we are using AEM 6.5.4. Thank you very much,
It saves the fileReference in individual item node(item0, item1...) in the name fileReference. If you add a property named fileReferenceParameter-> custom name(in the sample, have used imageInMulti) to the fileupload field, then the value will be saved in the respective property name in the item node.
Note : Rendering logic is not added to HTL.
Please try and let know if it works
Major difference I could see in your dialog XML is that it has mix of Coral UI 2 and Coral UI 3 fields. It is recommended to follow any one of this and not mix of both.