Hi All,
My requirement : I have a component which accepts some text say "#abc" as a dialog property. The current page URL, say "http://localhost:4502/content/xyz.html", has to be appended with the dialog property value as "http://localhost:4502/content/xyz.html#abc" before the page gets refreshed after edit of the dialog. So, when we close the dialog editor the page should get refreshed with the appended URL and not the initial page URL.
Is there a way to define a custom value for the afteredit cq:listener where i can define my javascript logic? or any other approach to achieve this functionality?
Any help is appreciated.
Thanks in advance.
Solved! Go to Solution.
1. have a clientlibs with category cq.authoring.dialog
2. Add a js file with this wrapper code - It defines the base for listener, you should be able to place your code here.
(function ($, $document) {
$document.on("dialog-ready", function() {
// Dialog is loaded
});
$(document).on("click", ".cq-dialog-submit", function (e) {
// Dialog submit event
});
})($, $(document));
classic or touch ui?
Views
Replies
Total Likes
would like to implement on both
Views
Replies
Total Likes
I was able to implement it on classic UI using the beforesubmit listener on the dialog, defining the logic using JS. However, could anyone please direct me to the right documentation talking about dialog listeners for Touch UI. A generalized guide may be?
Views
Replies
Total Likes
1. have a clientlibs with category cq.authoring.dialog
2. Add a js file with this wrapper code - It defines the base for listener, you should be able to place your code here.
(function ($, $document) {
$document.on("dialog-ready", function() {
// Dialog is loaded
});
$(document).on("click", ".cq-dialog-submit", function (e) {
// Dialog submit event
});
})($, $(document));
Thank you!! that works!
Views
Replies
Total Likes
Views
Like
Replies
Views
Like
Replies
Views
Likes
Replies
Views
Likes
Replies