Carousel Dialog Listener | Community
Skip to main content
November 21, 2016
Solved

Carousel Dialog Listener

  • November 21, 2016
  • 2 replies
  • 841 views

I have a multifield containing fields image path,image description,image heading,button label and button url.

Here i want to get button label (xtype-Text field) and button url (xtype-pathfield) values at the dialog level listener.

function(dialogObj)
              {
                
                var multifield= dialogObj.getField("./carousel");//carousel is the name of the multifield.
                
                var buttonLabel = multifield.items.items[3];//to access button label
                
                
                }

I have used the above code.Here i am not able to get the value present in button label field.

I have attached the screenshot of my dialog.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

To successfully work with a Multifield and read the values in a field located in a MF - see this article: 

https://helpx.adobe.com/experience-manager/using/jstl.html

Hope this helps... 

2 replies

kautuk_sahni
Community Manager
Community Manager
November 21, 2016

Hi

The dialog image you are showing seems like of classic UI (Or Touch Ui dialog is not created).

For Classic UI (Dialog listener) :- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__abnt-after_insertingdata.html

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));

 

You can implement dialog listener and with listener event you can collect data easily.

~kautuk

Kautuk Sahni
smacdonald2008
smacdonald2008Accepted solution
Level 10
November 24, 2016

To successfully work with a Multifield and read the values in a field located in a MF - see this article: 

https://helpx.adobe.com/experience-manager/using/jstl.html

Hope this helps...