Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Coral Pathfield not working properly

Avatar

Level 1

Hi,

 

I'm working with AEM 6.5 on-premise with the 6.5.15.0 SP installed, and currently, the pathfield is not working correctly. The dialog to select a path won't open, and in the console, it says next:

Uncaught TypeError: currentColumnEl is undefined

 If a value is entered into the input area, for example "/", then the dialog opens appropriately and you can select a path as you wish.

This is the .xml file and how it's currently set up:

<?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="Properties"
    sling:resourceType="cq/gui/components/authoring/dialog">
    <content
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
        <items jcr:primaryType="nt:unstructured">
            <column
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/container">
                <items jcr:primaryType="nt:unstructured">
                    <text
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                        fieldLabel="Text"
                        name="./text"/>
                    <test
                       jcr:primaryType="nt:unstructured"
                       sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                       fieldLabel="Test"
                       fieldDescription="Test"
                       name="./test"
                       rootPath="/content/"/>
                </items>
            </column>
        </items>
    </content>
</jcr:root>

 

Is this a bug, or am I missing something? Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @matzika,

The issue is caused by incorrect value in rootPath property, it should not end with /.

Use:

 

rootPath="/content"

 

instead:

 

rootPath="/content/"

 

Full config will look like this:

 

                    <test
                       jcr:primaryType="nt:unstructured"
                       sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                       fieldLabel="Test"
                       fieldDescription="Test"
                       name="./test"
                       rootPath="/content"/>

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @matzika,

The issue is caused by incorrect value in rootPath property, it should not end with /.

Use:

 

rootPath="/content"

 

instead:

 

rootPath="/content/"

 

Full config will look like this:

 

                    <test
                       jcr:primaryType="nt:unstructured"
                       sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                       fieldLabel="Test"
                       fieldDescription="Test"
                       name="./test"
                       rootPath="/content"/>