Dear Good People,
I am new in using AEM(Adobe Experience Manager)
I have a page that contains 2 or more components in a responsivegrid(wcm/foundation/components/responsivegrid) component area.
For example component date_event period that contains only 2 nodes which are :
- node start date (datepicker)
- node end date (datepicker)
in the file date_event.js within in component date_event, i retrieve those both nodes and return it.
then I have other component that want to retrieve node start date & end date from date_event component, but i got stuck while working on it.
So i need help how to figure it out?
Solved! Go to Solution.
Views
Replies
Total Likes
From my understanding - you have a separate HTL component and you want it to retrieve the value of a data component on another page.
If this is the case - you will have much more control using Java API to read node properties and using WCMUSePOJO as opposed to JS USE.
See this article - Scott's Digital Community: Creating an AEM HTML Template Language component that uses the WCMUsePojo...
It will teach you how to use the Java side of a HTL component. Then you can use Java APIs to read node props on a page.
Views
Replies
Total Likes
You need to locate the first resource and then iterate over its properties... So, from component 2, you should get its parent..something like resource.getParent()... this is common parent for both your components... then do parentComponent.getChild(<first component path>). Now that you have it, you can read values from it...
Views
Replies
Total Likes
From my understanding - you have a separate HTL component and you want it to retrieve the value of a data component on another page.
If this is the case - you will have much more control using Java API to read node properties and using WCMUSePOJO as opposed to JS USE.
See this article - Scott's Digital Community: Creating an AEM HTML Template Language component that uses the WCMUsePojo...
It will teach you how to use the Java side of a HTL component. Then you can use Java APIs to read node props on a page.
Views
Replies
Total Likes
See this thread too -- How to access component properties from a Java Class(AEM 5.6.1)
Views
Replies
Total Likes
Views
Likes
Replies