Pathfield component for json data | Community
Skip to main content
January 23, 2023
Solved

Pathfield component for json data

  • January 23, 2023
  • 2 replies
  • 1303 views

Hi,

 

Is there any way to inject json data (tree like structure) to path field component?

 

Scenario:

Earlier, I was storing 3rd party data to AEM and then using path field component to select the data. Now, I am not storing it any more to AEM due to performance issue and it will be there in in-memory cache data. However, I don't want to change my way of selection as editors are adapted to that (dont want to move to drop down), so I am looking for a way to inject json data to path field and show tree like structure. 

 

 

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

To select a path thru pathbrowser that particular path should always be there in aem before dialog open, then only pathbrowser will be able to show you the content tree to be selected. 

As you don't wanted to go with dropdown you have only one option I can see, which is by using Javascript, when you open the dialog to configure, same time get the json and generate a selectable flyout out of the json then on selection, assign the value to the path filed.

But this is not going to be a easy way 
I would suggest think of someother way like dropdown.

2 replies

Umesh_Thakur
Community Advisor
Umesh_ThakurCommunity AdvisorAccepted solution
Community Advisor
January 23, 2023

To select a path thru pathbrowser that particular path should always be there in aem before dialog open, then only pathbrowser will be able to show you the content tree to be selected. 

As you don't wanted to go with dropdown you have only one option I can see, which is by using Javascript, when you open the dialog to configure, same time get the json and generate a selectable flyout out of the json then on selection, assign the value to the path filed.

But this is not going to be a easy way 
I would suggest think of someother way like dropdown.

Anudeep_Garnepudi
Community Advisor
Community Advisor
January 24, 2023

@girtorapankaj 

 

I don't think this can be achieved using path browser. Path browser is for selecting a path within JCR and should only use to select path not JSON data.

Where is this cached data is? How authors will select that using path browser if you want to use it?