Hello All,
Is there a way to have component specific dialog listeners ? I have a clientlibrary created with categories cq.authoring.dialog and a function on save of dialog. This however gets invoked on every dialog save. How could i make it component specific?
Usecase would be i want to validate if the droptarget has an image set
$(document).on("click", ".cq-dialog-submit", function (e) {
alert("hello !on submit");
});
Solved! Go to Solution.
Views
Replies
Total Likes
@Kishore_Kumar_ Used something like this with validate at droptarget and it applied to that component itself on 64..Thanks for the help. I would definitely try your approach on 65 since i like to use dialog functions
(function(ns, $, $document){
$(window).adaptTo("foundation-registry").register("foundation.validation.validator",{
selector: "[data-validation='xxx-validation']",
});
});
Hi,
We can make use of extraClientlibs or includeclientlibs to load a dialog specific clientlibs.
https://wcmaem.blogspot.com/2016/08/how-to-load-touchui-dialog-specific.html?m=1
Thanks for the response but i am not sure i understand. Is this compatible with 6.4 or 6.5? And my use case would be to validate if on save of the dialog, the droptarget has an image or not set for that component.
Update putting in extraclientlibs in 6.4 just brings up validation for every component dialog save @Kishore_Kumar_
please let me know
Views
Replies
Total Likes
Hi @NitroHazeDev ,
We have to use custom clientlibs category name (not cq.authoring.dialog) and add in extraClientlibs property.
Views
Replies
Total Likes
I thought that did it but clearing the cache that did not work. Set the extraclientlibs at cq:dialog node with another clientlibrary and also added the script to the JS .But on save the dialog is invoked for any component not just the one we want to @Kishore_Kumar_
I am on 6.4
Views
Replies
Total Likes
@Kishore_Kumar_ Used something like this with validate at droptarget and it applied to that component itself on 64..Thanks for the help. I would definitely try your approach on 65 since i like to use dialog functions
(function(ns, $, $document){
$(window).adaptTo("foundation-registry").register("foundation.validation.validator",{
selector: "[data-validation='xxx-validation']",
});
});
Views
Like
Replies