May 22, 2020
Estimated Post Reading Time ~

AEM pathfield appending values without changing

I have a path field widget in AEM for error page handling.

I have added it at the base page implementation and when I try and select the path, I see that there is a "," appended to the path. If I clear the field and save, I see that the old path still exists. If I add a new path, I see that the new path is appended to the old path saperated by a comma.



Fig 1: Intially the error pages is coming up good.
Fig 2: After clicking OK and checking the properties again (Note the "," that is being appended)
Fig 3: After adding a new path (Again the path is appended after the ",")

Has anyone faced the same issue. I tried different forums but wasn't able to get any answers. The same configuration is working fine on my local but it is creating a problem when I push the same code to the server.

Updated
dialog.xml - Here I'm defining the tab where the the error pages path field is displayed



<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
height="400"
stateful="false"
xtype="dialog">
<items jcr:primaryType="cq:WidgetCollection">
    <tabs jcr:primaryType="cq:TabPanel">
        <items jcr:primaryType="cq:WidgetCollection">
            <livecopy
                jcr:primaryType="cq:Widget"
                path="/libs/foundation/components/page/tab_livecopy.infinity.json"
                xtype="cqinclude"/>
            <mytab
                jcr:primaryType="cq:Widget"
                path="/apps/webex/eopi/components/pages/home-page/tab_something.infinity.json"
                xtype="cqinclude"/>
        </items>
    </tabs>
</items>
</jcr:root>
tab_something.xml - Defining the pathfield widget for errorpages

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Panel"
title="Webex">
<items jcr:primaryType="cq:WidgetCollection">
    <basic
        jcr:primaryType="cq:Widget"
        collapsed="{Boolean}false"
        collapsible="{Boolean}false"
        xtype="dialogfieldset">
        <items jcr:primaryType="cq:WidgetCollection">
            <errorpages
                jcr:primaryType="cq:Widget"
                fieldDescription="Error pages for this content tree"
                fieldLabel="Error Pages"
                name="./errorPages"
                xtype="pathfield"/>
        </items>
    </basic>
</items>
</jcr:root>

Best How To:
To answer, there was a pathfield node by the same name under foundation and I had overlooked it. Removed the node and it is working good now.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.