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

Pathfield component for json data

Avatar

Level 2

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. 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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.

Avatar

Community Advisor

@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?