Hi,
When I create a property page, input the content and click the Create button. The aem save very slow, the user don't understand it saving. So they click again on the Create button. After that the aem save two time and the content is duplicate (it create two page content). I want to display the gif file (example Saving or Creating) it will showing when click on the Create button for the user know and waiting for create finish.
How to do that?
Thanks & Best regards,
BienHV
Solved! Go to Solution.
Views
Replies
Total Likes
Below code should work:
Clientlib category - granite.ui.coral.foundation
/* JS Code to disable create button*/
(function(document, $) {
$( document ).ready(function() {
console.log( "ready!" );
var formSelector = "form.cq-siteadmin-admin-createpage";
var selector = "form.cq-siteadmin-admin-createpage .foundation-layout-wizard2-header .coral-Panel button[type=submit]";
var selectorBtn = "coral-dialog.coral-Dialog.coral-Dialog--success.is-open>div.coral-Dialog-wrapper>coral-dialog-footer>button";
$(formSelector).on('submit', function() {
$(selector).attr("disabled", "disabled");
console.log("button disabled");
});
$("body").on('click', selectorBtn, function() {
$(selector).removeAttr("disabled");
console.log("button enabled");
});
});
})(document, Granite.$);
Views
Replies
Total Likes
Hi,
You can disabled Create button once clicked and enable it again as soon as page created and OOTB popup displayed.
in popup there are two buttons, open and done. on click of any button you can enabled create button again. Thats how you can prevent duplicate page creation.
Views
Replies
Total Likes
Last week I tried disabled Create button when clicked and enabled it again as soon as page created. However, it work fine with save button, but it not right for Create button.
Views
Replies
Total Likes
I'll try same and get back to you.
Views
Replies
Total Likes
Thanks you,
I am hearing from you.
Views
Replies
Total Likes
Below code should work:
Clientlib category - granite.ui.coral.foundation
/* JS Code to disable create button*/
(function(document, $) {
$( document ).ready(function() {
console.log( "ready!" );
var formSelector = "form.cq-siteadmin-admin-createpage";
var selector = "form.cq-siteadmin-admin-createpage .foundation-layout-wizard2-header .coral-Panel button[type=submit]";
var selectorBtn = "coral-dialog.coral-Dialog.coral-Dialog--success.is-open>div.coral-Dialog-wrapper>coral-dialog-footer>button";
$(formSelector).on('submit', function() {
$(selector).attr("disabled", "disabled");
console.log("button disabled");
});
$("body").on('click', selectorBtn, function() {
$(selector).removeAttr("disabled");
console.log("button enabled");
});
});
})(document, Granite.$);
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies