Fetching the path of current resource in datasource | Community
Skip to main content
Level 2
January 3, 2018
Solved

Fetching the path of current resource in datasource

  • January 3, 2018
  • 2 replies
  • 1396 views

We have a requirement to dynamically populate a list in an inner component based on the content of the parent component.

So, I have a component say abc, with a property value authored as (key:p1, value-v1). In the dialog of the child component of abc component, I am including a data source to fetch a dynamic list. Now this dynamic list has to be created based on the p1 property set in the parent component i,e abc.

Can someone help me out here as to how to fetch the current component content resource inside the data source?

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 edubey

You can use code from here to get the current resource name in datasource.

http://www.adobeaemclub.com/how-to-fetch-current-resource-path-in-datasource/

Once you have the current resource name, you can reach out to parent and read the properties before creating list

2 replies

edubey
edubeyAccepted solution
Level 10
January 3, 2018

You can use code from here to get the current resource name in datasource.

http://www.adobeaemclub.com/how-to-fetch-current-resource-path-in-datasource/

Once you have the current resource name, you can reach out to parent and read the properties before creating list

w0lver_n3Author
Level 2
January 3, 2018

You saved my day, thanks buddy