Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Listeners implementations in touch UI.

Avatar

Level 3

Hi all,

I would like to know how can we call any servlet in touch ui dialog?

ie.

On select of dropdown i need to pass the selected value to servlet.

 

Thanks,

Shivamurthy Mn

1 Accepted Solution

Avatar

Correct answer by
Administrator

For Touch Ui (Dialog Listner) :- https://helpx.adobe.com/experience-manager/using/creating-touchui-events.html

    // (function ($, $document) {
        "use strict";
          $document.on("dialog-ready", function() {
            $(window).adaptTo("foundation-ui").alert("Open", "Dialog now open, event [dialog-ready]");
        });
        $(document).on("click", ".cq-dialog-submit", function (e) {
            //$(window).adaptTo("foundation-ui").alert("Close", "Dialog closed, selector [.cq-dialog-submit]");
        });
        $document.on("dialog-ready", function() {
            document.querySelector('form.cq-dialog').addEventListener('submit', function(){
                //$(window).adaptTo("foundation-ui").alert("Close", "Dialog closed, selector [form.cq-dialog]");
            }, true);
        });
        $document.on("dialog-success", function() {
            //$(window).adaptTo("foundation-ui").alert("Save", "Dialog content saved, event [dialog-success]");
        });
        $document.on("dialog-closed", function() {
            $(window).adaptTo("foundation-ui").alert("Close", "Dialog closed, event [dialog-closed]");
        });
    })($, $(document));

Extra reference articles are :-

Link:- https://helpx.adobe.com/experience-manager/using/creating-touchui-events.html

Link:- http://stackoverflow.com/questions/30053519/list-of-listeners-in-aem-6-for-touch-ui

Link:- http://experience-aem.blogspot.in/2015/02/aem-6-sp2-touch-ui-dialog-before-submit.html  // AEM 6 SP2 - Touch UI Dialog Before Submit Confirmation

 

Also you can use AEM Touch UI Custom Validation and in validate function you can check or trigger any event.

Link:- http://www.nateyolles.com/blog/2016/02/aem-touch-ui-custom-validation

 

I hope this would help you.

~kautuk



Kautuk Sahni

View solution in original post

3 Replies

Avatar

Correct answer by
Administrator

For Touch Ui (Dialog Listner) :- https://helpx.adobe.com/experience-manager/using/creating-touchui-events.html

    // (function ($, $document) {
        "use strict";
          $document.on("dialog-ready", function() {
            $(window).adaptTo("foundation-ui").alert("Open", "Dialog now open, event [dialog-ready]");
        });
        $(document).on("click", ".cq-dialog-submit", function (e) {
            //$(window).adaptTo("foundation-ui").alert("Close", "Dialog closed, selector [.cq-dialog-submit]");
        });
        $document.on("dialog-ready", function() {
            document.querySelector('form.cq-dialog').addEventListener('submit', function(){
                //$(window).adaptTo("foundation-ui").alert("Close", "Dialog closed, selector [form.cq-dialog]");
            }, true);
        });
        $document.on("dialog-success", function() {
            //$(window).adaptTo("foundation-ui").alert("Save", "Dialog content saved, event [dialog-success]");
        });
        $document.on("dialog-closed", function() {
            $(window).adaptTo("foundation-ui").alert("Close", "Dialog closed, event [dialog-closed]");
        });
    })($, $(document));

Extra reference articles are :-

Link:- https://helpx.adobe.com/experience-manager/using/creating-touchui-events.html

Link:- http://stackoverflow.com/questions/30053519/list-of-listeners-in-aem-6-for-touch-ui

Link:- http://experience-aem.blogspot.in/2015/02/aem-6-sp2-touch-ui-dialog-before-submit.html  // AEM 6 SP2 - Touch UI Dialog Before Submit Confirmation

 

Also you can use AEM Touch UI Custom Validation and in validate function you can check or trigger any event.

Link:- http://www.nateyolles.com/blog/2016/02/aem-touch-ui-custom-validation

 

I hope this would help you.

~kautuk



Kautuk Sahni