afteredit cq:listerner for page properties in Touch UI AEM 6.3

Accepted Solutions (1)

Accepted Solutions (1)

Gaurav-Behl

MVP

13-02-2019

(function ($, $document) {

    "use strict";

     $document.on("dialog-success", function(e) {

                     // add the logic to run this code only for certain page/use case

                     // pick that specific pathfield/browser element and then you can get its value easily

                    // get the selected value and perform validations, if any

                    // populate other textfield/element based on some logic

         });

})($, $(document));

Answers (4)

Answers (4)

ybharath264

13-02-2019

Hey Gaurab, Thank you for the insight.

I am trying this out with a authoring dialog clientlib.  But not sure how to get the Resource or Node values here if I take this approach. Any suggestions ?

(function ($, $document) {

    "use strict";

     $document.on("dialog-success", function() {

                    alert();

         });

})($, $(document));

Gaurav-Behl

MVP

13-02-2019

what would be the trigger for this listener? I doubt that pathfield can generate an event when a path is selected however, you could use the "select/Okay" button or dialog close event of the pathbrowser/pathfield to perform custom action.

How would you locate that pathfield/pathbrowser element unless you hardcode its id/class in some way for '/mnt/overlay/wcm/core/content/sites/properties.html?item= <something>'.  I assume that you plan to localize this implementation within your project.

may be use this class 'granite-pickerdialog-submit' for the trigger or use '<pathfield_element_container>.cq-dialog-submit' or 'dialog-closed' to write you code.

This example might help to get started - Experiencing Adobe Experience Manager - Day CQ: AEM 61 - Touch UI Rich Text Editor (RTE) Browse and ...

ybharath264

13-02-2019

I have path field in one of my tabs in the page properties, Based on the input value of that field, I want to update a check box field in one of the other tabs in the page properties.

I tried to place this logic in a sling model, but the sling model is invoking only when the template (html) is called, meaning it works only when the page is open and I try to edit the properties. But If I directly edit the properties from Sites, the sling model will not invoke.  So trying to incorporate it into a cq:listener.