Expand my Community achievements bar.

Path field throwing error in AEM 6.4 Touch UI

Avatar

Level 2

I am using granite/ui/components/coral/foundation/form/pathfield and when I click on the icon, it doesn't open the window but throws an error in the console.

/mnt/overlay/granite/ui/content/coral/foundation/form/pathfield/picker.html…t%2fdam%2fca&filter=hierarchyNotFile&selectionCount=single&_=1524569289626 Failed to load resource: the server responded with a status of 404 (Not Found)

I see that the image is present in the dam but still the path field fails to load it.

1472592_pastedImage_3.png

If I delete the selected image from the field and then click on path field icon, then it opens up.

Is there some other settings or properties I need to add for the pathfield?

Can you provide a solution for same?

Thanks,

Anuradha

31 Replies

Avatar

Level 10

I am going to test the path field by adding it to the same project that can be installed from this article - that uses other granite/coral types.

Building Experience Manager Components using Granite/Coral Resource Types

Avatar

Level 10

I tested the Pathfield on AEM 6.4 and works fine, Here it is...

April24.png

To test this - install the package in the third section of the article above. The section is titled -- Add additional resource types to your component

This will give you this structure under /apps.

Apr241.png

Add a new node under items named video with the following Props:

Apr242.png

Open the Page here --

http://localhost:4502/editor.html/content/Lab2018/en.html

Update the /apps/Lab2018/components/content/firstcomponent/firstcomponent.html. Include these lines of code at end -- before closing </div>

         <p>

            <b>path finder:</b> ${properties.video}

        </p>

Now open the dialog and you will see the pathfinder:

Apr243.png

This value now prints out on the page --

Apr244.png

Try this all on a fresh AEM 6.4 DEV instance and i am sure you will get the same results.

Avatar

Level 2

Thanks for your reply. You have Pathbrowser and that works fine.I have used Pathfield which is giving me a problem - granite/ui/components/coral/foundation/form/pathfield.

Could you please check for sling:resourceType as pathfield (above path)

Thanks,

Anuradha

Avatar

Level 10

I am still seeing it work well when i change the resource type to this:

granite/ui/components/coral/foundation/form/pathfield

The result...

Apr246.png

Avatar

Level 10

What browser are using - i tested on Chrome and Firefox.

Avatar

Level 10

Try the steps that i listed above on a fresh install. use that package and add a new node with the resource type -- granite/ui/components/coral/foundation/form/pathfield.

I am not seeing any errors.

Avatar

Level 2

This is some issue which is coming up in our QA server of Aem 6.4. It works fine in localhost.

I compared the pathfield's code thinking there might be some difference in localhost granite/ui/components/coral/foundation/form/pathfield  and QA's pathfield but there is no difference. I am not sure what's causing the problem.

Avatar

Level 10

There is an issue in your QA instance. OOTB - as this package in the article shows - when you add the new node - path field works.

Are you seeing any errors in the log?

Avatar

Level 2

I will have to check the logs.I'll get back ,once I check the same.

Thanks,

Anuradha

Avatar

Level 2

I have checked the logs and dont anything logged specifically for pathfield in it. However, we are having a re-installation of 6.4 to our server and hopefully it would solve it.

Avatar

Employee

anuradhar46910715​ Do the below and let me know if it doesn't work

Avatar

Level 2

Thanks for the solution will apply it if reinstallation doesnt work fine.

Avatar

Level 10

I have never had to make these configurations on AEM 6.3 or 6.4 to get the granite/Coral resource types work. They should work by default.

Avatar

Employee

This usually happens when you upgraded from 5.x to 6.x and the config changes affects the underlying overridden methods.

Avatar

Level 10

That explains why i have never seen that. I use fresh instances.

Avatar

Level 4

Hi smacdonald2008​ and Kunwar​,

I've started seeing a similar problem today - AEM 6.3 with service pack 6.3.1.

I've extended the pathfield component with some small changes.  All works ok on my local dev environment - brings up the picker and allows me to select items from the aem assets/dam.  When I deploy same code to an aem instance (same version and service pack) running on  a VM and try and author a page, clicking the pathfield 'tick' icon produces an error in the browser similar to the poster's original report:

http://dev-author.westeurope.cloudapp.azure.com:4502/mnt/overlay/myapp/components/widget/content/pat... 404 (Not Found)

  XMLHttpRequest.send @ granite.js:234

  send @ jquery.js:10254

  ajax @ jquery.js:9738

  resolveElement @ foundation.js:2143

  Prototype._togglePicker @ foundation.js:2796

  (anonymous) @ foundation.js:2267

Do you have any idea what might be causing this - given the earlier discussion?  Logs don't tell me much beyond what I already know.

  1. In both cases - local and dev VM - I am signed on as the administrator so presumably have no issues with access privileges
  2. The custom code seems to be there, in the expected place
  3. Following Kunwar's advice doesn't seem to apply - felix configMgr only mentions "Apache Sling Rhino JavaScript Engine Factory" and "Apache Sling Scripting HTL JavaScript Use-API Factories Configuration" (which don't include the settings described above)

Avatar

Level 10

"I've extended the pathfield component with some small changes" - what changes did you do?

Avatar

Level 4

Hi smacdonald2008

generally, I've added some clientlibs and extended (by copying and amending the copied jsps etc) to add additional markup.  In the main pathfield render.jsp I have amended the line that assigns the defaultPickerSrc variable, so it now looks like the following,

final String defaultPickerSrc = "/mnt/overlay/myapp/components/widget/content/pathfield/picker.html" +

            "{value}" +

            "?_charset_=utf-8&root=" + Text.escape(rootPath) + "&filter=" + Text.escape(filter) + "&selectionCount=" + Text.escape(selectionCount);

  

Re the location relating to the not found request, i.e. /apps/myapp/components/widget/content/pathfield/picker, I've added a straight copy of /libs/granite/ui/content/coral/foundation/form/pathfield and added under my copy of that node 'actions/primary/clientlibs' child nodes, where I specify that I want to load the clientlibs when the picker dialog is opened.  That node is at /apps/myapp/components/widget/content/pathfield/picker/actions/primary/clientlibs (and has a "categories" property to reference the client library).

Avatar

Level 10

So it works without this code and then when you add this logic - it does not work properly. Are you following an Adobe Doc or community article to see if this can be reproduced?