Pathbrowser and fileupload not working first time inside coral multifield ? | Community
Skip to main content
Level 2
September 19, 2017

Pathbrowser and fileupload not working first time inside coral multifield ?

  • September 19, 2017
  • 3 replies
  • 9178 views

Having a component with following cq:dialog.

After clicking add button in multi-filed, as expected i am getting Pathbrowser and fileupload field which is not working. if i close the dialog and open again both fields are started working (i can able to browse file and upload image).

1, Is it a bug ? or am i missing anything here ?

2, Pathbrowser or fileupload which is best to use for images ?

I understand the difference that in Pathbrowser we can restrict user to specific path, but user will not have image preview (am i correct ?)

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"

    jcr:primaryType="nt:unstructured"

    jcr:title="Product Banner"

    sling:resourceType="cq/gui/components/authoring/dialog">

    <content

        jcr:primaryType="nt:unstructured"

        sling:resourceType="granite/ui/components/foundation/container">

        <layout

            jcr:primaryType="nt:unstructured"

            sling:resourceType="granite/ui/components/foundation/layouts/tabs"

            type="nav"/>

        <items jcr:primaryType="nt:unstructured">

            <tab1

                jcr:primaryType="nt:unstructured"

                jcr:title="Left Banner Box"

                sling:resourceType="granite/ui/components/foundation/container">

                <layout

                    jcr:primaryType="nt:unstructured"

                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>

                <items jcr:primaryType="nt:unstructured">

                    <columns

                        jcr:primaryType="nt:unstructured"

                        sling:resourceType="granite/ui/components/foundation/container">

                        <items jcr:primaryType="nt:unstructured">

                            <title

                                jcr:primaryType="nt:unstructured"

                                sling:resourceType="granite/ui/components/foundation/form/textfield"

                                fieldLabel="Title"

                                name="./title"/>

                            <description

                                jcr:primaryType="nt:unstructured"

                                sling:resourceType="granite/ui/components/foundation/form/textarea"

                                fieldLabel="Description"

                                name="./description"/>

                            <linktext

                                jcr:primaryType="nt:unstructured"

                                sling:resourceType="granite/ui/components/foundation/form/textfield"

                                fieldDescription=" Link Text"

                                fieldLabel="Link Text"

                                name="./linktext"/>

                            <linkurl

                                jcr:primaryType="nt:unstructured"

                                sling:resourceType="granite/ui/components/foundation/form/pathbrowser"

                                fieldDescription="Link URL"

                                fieldLabel="Link URL"

                                name="./linkurl"/>

                        </items>

                    </columns>

                </items>

            </tab1>

            <tab2

                jcr:primaryType="nt:unstructured"

                jcr:title="Product Box List"

                sling:resourceType="granite/ui/components/foundation/section">

                <layout

                    jcr:primaryType="nt:unstructured"

                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"

                    margin="{Boolean}false"/>

                <items jcr:primaryType="nt:unstructured">

                    <column

                        jcr:primaryType="nt:unstructured"

                        sling:resourceType="granite/ui/components/foundation/container">

                        <items jcr:primaryType="nt:unstructured">

                            <list

                                jcr:primaryType="nt:unstructured"

                                sling:resourceType="granite/ui/components/coral/foundation/form/multifield"

                                composite="{Boolean}true"

                                fieldDescription="Click + to add a new list item"

                                fieldLabel="Product List"

                                name="./list">

                                <field

                                    jcr:primaryType="nt:unstructured"

                                    sling:resourceType="granite/ui/components/coral/foundation/container"

                                    name="./items">

                                    <items jcr:primaryType="nt:unstructured">

                                        <image

                                            jcr:primaryType="nt:unstructured"

                                            sling:resourceType="cq/gui/components/authoring/dialog/fileupload"

                                            autoStart="{Boolean}false"

                                            class="cq-droptarget"

                                            fieldLabel="Product Image"

                                            fileNameParameter="./fileName"

                                            fileReferenceParameter="./fileReference"

                                            mimeTypes="[image]"

                                            multiple="{Boolean}false"

                                            name="./file"

                                            title="Upload Image Asset"

                                            uploadUrl="${suffix.path}"

                                            useHTML5="{Boolean}true"/>

                                        <title

                                            jcr:primaryType="nt:unstructured"

                                            sling:resourceType="granite/ui/components/foundation/form/textfield"

                                            fieldLabel="Product Title"

                                            name="./productTitle"/>

                                        <description

                                            jcr:primaryType="nt:unstructured"

                                            sling:resourceType="granite/ui/components/foundation/form/textarea"

                                            fieldLabel="Description"

                                            name="./description"/>

                                        <linktext

                                            jcr:primaryType="nt:unstructured"

                                            sling:resourceType="granite/ui/components/foundation/form/textfield"

                                            fieldDescription=" Link Text"

                                            fieldLabel="Link Text"

                                            name="./linktext"/>

                                        <linkurl

                                            jcr:primaryType="nt:unstructured"

                                            sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"

                                            fieldDescription="Link URL"

                                            fieldLabel="Link URL"

                                            name="./linkurl"/>

                                    </items>

                                </field>

                            </list>

                        </items>

                    </column>

                </items>

            </tab2>

        </items>

    </content>

</jcr:root>

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

3 replies

Manjunath_DJ
Level 2
September 19, 2017

Hi

Can you check console errors when dialog is breaking/not opening and try adding listener after edit so page refresh happens.

Console error could help to know whats breaking in the java script .

Check the below links for Touch multi field Dialog

Adobe Experience Manager Help | Creating an AEM 6.2 HTML Template Language component that uses a Multi-Field dialog

viswacAuthor
Level 2
September 19, 2017

Hi

There is no problem in opening dialog. Dialog works perfectly, problem only in multi-field.

There no error related to this issue in the console.

Manjunath_DJ
Level 2
September 19, 2017

Hi

I have implemented multi field as per the blog it works perfectly fine. can you go thru blog once upload demo package and try it

Which version of AEM are you using?

benoitl54314939
September 19, 2017

I have the same issue.

Fileupload or pathbrowser are not working in the multifield.  Pathfield is ok.

It's rendered properly but when dragging an asset on the fileupload nothing happens.

If I move my fileupload node outside of the multifield it works. 

I'm running aem 6.3 with sp2.

viswacAuthor
Level 2
September 20, 2017

Exactly 

smacdonald2008
Level 10
September 20, 2017

Just tried adding a file upload to a MF 6.3 dialog and it works:

As you can see - we can drag an image onto it.

You can try this too. Load the package from this artilce on 6.3:

Scott's Digital Community: Creating an Adobe Experience Manager Newsletter HTL component

Copy the file node and paste under the MF dialog. Open the example page and open the dialog - you will see the FIleUpload and you can drag images onto it. Now - you would need to change the Java code to make it render in the page - but the file upload does work in a MF.

October 9, 2017

Hi Scott,

I tried your approach but unfortunately on 6.3 I don't see a drop target, instead I see the upload Image asset button. I tried adding allowUpload to false but it's still an issue. Following is what I see.

I also tried the core image components fileupload resourcetype i.e cq/gui/components/authoring/dialog/fileupload, with this I do see the drop container but when I submit the dialog acs commons gets the value of the field as empty so in jcr the file attribute is set to "". tried both NODE_STORE and JSON_STORE.