The purpose of the following function is to allow the user to save the edited page properties in the CQ-Dialog
even though if they invalid by clicking on the button save anyway
:
PageProperties.showMsg = function(dialog, config, errorMessage) {
CQ.Ext.MessageBox.buttonText.ok = "save anyway";
CQ.Ext.Msg.show({
title : "Completeness check failed",
msg : errorMessage,
buttons: CQ.Ext.Msg.OKCANCEL,
fn : function(buttons) {
if(buttons == "ok") {
dialog.form.items.each(function(field) {
// clear fields with emptyText so emptyText is not submitted
if (field.emptyText && field.el && field.el.dom && field.el.dom.value == field.emptyText) {
field.setRawValue("");
}
});
var action = new CQ.form.SlingSubmitAction(dialog.form, config);
dialog.form.isValid = function() {
return true;
};
dialog.form.doAction(action);
dialog[dialog.closeAction]();
CQ.Util.reload();
}
}
});
};
This functions works fine from the sidekick
. When I click on save anyway
all current values of the page properites are stored regardless if they are valid or not. This does not work from the site admin
. when I call the page properties
of the same page from the site admin
and try to save the page properties with invalid values by clicking on save anyway
, this does not works (old values are stored and nothing changes).
I hope somebody can help. thank you