I am trying to create a custom multifield in touchUI scaffold. i have created the following structure -
<pages jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/multifield" class="full-width" eaem-nested="" fieldDescription="Click '+' to add a new page" fieldLabel="URLs"> <field jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/fieldset"> <items jcr:primaryType="nt:unstructured"> <page jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/textfield" fieldDescription="Enter Page Name" fieldLabel="Page Name" name="./page"/> <path jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/pathbrowser" fieldDescription="Select Path" fieldLabel="Path" name="./path" rootPath="/content"/> </items> </field> </pages>
I am able to see the multifield and even data is stored in the repository, but when I open the scaffold again, i don't see these values prepopulated.
Can you help me how to solve this ?
I would recommend you to check this Adobe Helpx article :-
//Creating an AEM HTML Template Language component that uses a Multifield control
You can play this the package provided and can modify it as per you case.
Thanks and Rgards
Is the issue with multifield in touch ui dialog of scaffold resolved? I have similar requirement where multifield needs to be present in scaffold page(touch ui dialog).
The issue is that already entered data does not appear on dialog within multifield on subsequent edits even though data is stored in crx(in string array format).
Thanks & Regards,
Could still be a bug. As it works perfectly fine in a component dialog - but issues in a TouchUI Scaffold -- then log a bug and let support know.
Seems like there there is no solution due to technical limitation, only changing/creating new component, we have opened a ticket with Adobe and this is the reply we have got:
"The behavior you are witnessing is an expected behavior.
It is not recommended to use the multi-field for the product scaffolding as creating sub nodes for product attributes is orthogonal to the expected product data structure. Products attributes should be stored directly at the product or variant node. Child nodes ideally are only used for variations or assets.
The way the product scaffolding works for products, it flattens the structure when the form POST is send, so any sub node information will be lost already in the java-script (except for assets). So the structure needed for the multi field is already lost before the data reaches the server.
If you still want to use the multi-field, you have to customize the multi-field to understand the attributes stored as string values and correctly displaying them in the scaffolding."
"customize the multi-field to understand the attributes stored as string values".
For the customization, can you please provide more details on the files(guessing .js file(s)) that actually stores the product scaffold data in the JCR.
In acs-commons, touchui-composite-multifield.js is used to store the attributes as string values. Few of the css classes would be missing in the product scaffolding if you compare with a component dialog. If those are corrected along with the few other changes, values can be stored as string in the product scaffolding.
Is there any update on this issue?
I'm facing the same issue. Values are saved in a different structure than component multifield and presenting them in not working.
Is it possible to add multifield to scaffolding?