Expand my Community achievements bar.

SOLVED

Fetching the path of current resource in datasource

Avatar

Level 2

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?

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

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