In a parsys section we can place a component placeholder. On editing the component placeholder a dialog box will appear to which a listener is configured. Is there a way for the listener to know in which parsys the component placeholder is being placed?
Note: Parent node of component placeholder is the parsys node
Purpose: Based on which parsys the component placeholder is located I need to validate entries in the dialog of the component placeholder. The listener passes the values entered in dialog box to a servlet where the validation happens and if valid the component placeholder will display the component.
Solved! Go to Solution.
Use path property for dialog object
function(dialog){
console.log(dialog.path);
}
https://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html?class=CQ.Dialog
SO you are looking for a way to dynamically get the path of a component (a placeholder) that you drop into an AEM page?
Views
Replies
Total Likes
Take a look at this community article - it may help you:
Use path property for dialog object
function(dialog){
console.log(dialog.path);
}
https://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html?class=CQ.Dialog
smacdonald2008 wrote...
SO you are looking for a way to dynamically get the path of a component (a placeholder) that you drop into an AEM page?
Yes exactly.
Views
Replies
Total Likes
Thank you! I am trying to get the same value in AEM 6 inside dailog listener.
Views
Replies
Total Likes
edubey wrote...
Use path property for dialog object
function(dialog){
console.log(dialog.path);
}
https://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html?class=CQ.Dialog
Thank you! Tried this but it says "dialog undefined". Any idea where do I define it or to which node(s) it can be used? The dialog node which I am using is having an xtype:dialog and jcr:primaryType as cq:Dailog.
Views
Replies
Total Likes
Check this image
This worked :) Thanks a ton!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies