What event should I be using to handle the afteredit in the cq:listener for page properties.
Solved! Go to Solution.
Views
Replies
Total Likes
(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));
Views
Replies
Total Likes
could you share more details about your use case?
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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 ...
Views
Replies
Total Likes
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));
Views
Replies
Total Likes
(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));
Views
Replies
Total Likes
Views
Likes
Replies