Expand my Community achievements bar.

SOLVED

move up/down in multifield with image not working properly

Avatar

Level 2

My component has a multifield with combination of title, description, link and image. I have authored the component with all the inputs and saved.

When I open the dialog again and try to move up/down the multifield cluster, all properties (except fileReference having image path) moves. Image does not change. Below is my cq:dialog.

 

<content sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns" jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<tabs sling:resourceType="granite/ui/components/foundation/layouts/tabs" jcr:primaryType="nt:unstructured" maximized="{Boolean}true">
<items jcr:primaryType="nt:unstructured" sling:hideChildren="[column]">
<list jcr:title="List" sling:resourceType="granite/ui/components/foundation/container" jcr:primaryType="nt:unstructured" showhidetargetvalue="static" class="carouseloptionlistfromshowhidetarget foundationlayoututilvmargin">
<items jcr:primaryType="nt:unstructured">
<pages
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
jcr:primaryType="nt:unstructured"
fieldLabel="Slides"
fieldDescription="Click the 'add' button to add a new slide"
eaemshowoncollapse="{Boolean}true"
composite="{Boolean}true">
<field sling:resourceType="granite/ui/components/coral/foundation/container" jcr:primaryType="nt:unstructured" name="./images">
<items jcr:primaryType="nt:unstructured">
<layout jcr:title="Expand to fill the details of slide" sling:resourceType="granite/ui/components/foundation/layouts/collapsible" jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<column sling:resourceType="granite/ui/components/foundation/container" jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<title sling:resourceType="granite/ui/components/coral/foundation/form/textfield" jcr:primaryType="nt:unstructured" name="./title" fieldLabel="Title:"/>
<path
title="Upload Image Asset"
sling:resourceType="cq/gui/components/authoring/dialog/fileupload"
jcr:primaryType="nt:unstructured"
name="./file" class="cqdroptarget"
useHTML5="{Boolean}true" multiple="{Boolean}false"
mimeTypes="[image/gif,image/jpeg,image/png,image/tiff,image/svgxml]"
fileReferenceParameter="./fileReference" fileNameParameter="./fileName"
autoStart="{Boolean}false" allowUpload="{Boolean}false"/>
<targeturl sling:resourceType="granite/ui/components/coral/foundation/form/pathfield" jcr:primaryType="nt:unstructured" name="targetUrl" fieldLabel="Target URL:"/>
</items>
</column>
</items>
</layout>
</items>
</field>
</pages>
</items>
</list>
</items>
</tabs>
</items>
</content>

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Nithyasri_K 

I just tried the same and it works for me. I am able to move the image path as well. Can you please try with the below code for image block only and see if it works?

<desktopimage
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/fileupload"
allowUpload="{Boolean}false"
autoStart="{Boolean}false"
class="cq-droptarget"
fieldDescription="Enter Desktop Image"
fieldLabel="Desktop Image"
fileNameParameter="./fileName"
fileReferenceParameter="./desktopImage"
mimeTypes="[image]"
multiple="{Boolean}false"
name="./desktop"
uploadUrl="${suffix.path}"
useHTML5="{Boolean}true"/>

granite/ui/components/foundation/form/fileupload is currently not supported on AEM 6.4 version. This works perfectly fine from 6.5 onwards.
Please go with pathfiled/pagefield resourceType and that will resolve the issue.

Hope this helps!

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

Hi @Nithyasri_K 

I just tried the same and it works for me. I am able to move the image path as well. Can you please try with the below code for image block only and see if it works?

<desktopimage
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/fileupload"
allowUpload="{Boolean}false"
autoStart="{Boolean}false"
class="cq-droptarget"
fieldDescription="Enter Desktop Image"
fieldLabel="Desktop Image"
fileNameParameter="./fileName"
fileReferenceParameter="./desktopImage"
mimeTypes="[image]"
multiple="{Boolean}false"
name="./desktop"
uploadUrl="${suffix.path}"
useHTML5="{Boolean}true"/>

granite/ui/components/foundation/form/fileupload is currently not supported on AEM 6.4 version. This works perfectly fine from 6.5 onwards.
Please go with pathfiled/pagefield resourceType and that will resolve the issue.

Hope this helps!

Avatar

Level 2
@Asutosh_Jena_ I tried and still getting the same error. I am working on AEM 6.4.0 with SP6.4.8

Avatar

Community Advisor
Will it be possible for you to send the component in a zip file so that it will be easier for debugging purpose?

Avatar

Community Advisor

 

@Nithyasri_K  granite/ui/components/foundation/form/fileupload is currently not supported on AEM 6.4 version. This works perfectly fine from 6.5 onwards.
Please go with pathfiled/pagefield resourceType and that will resolve the issue.

Hope this helps!