diff --git a/org.adempiere.ui.zk/index.zul b/org.adempiere.ui.zk/index.zul index cb93c1a172..dbd6769ad5 100644 --- a/org.adempiere.ui.zk/index.zul +++ b/org.adempiere.ui.zk/index.zul @@ -24,6 +24,28 @@ Copyright (C) 2007 Ashley G Ramdass. // just sent fake event when control is textfield and value is not yet sync to server if (wgt.$instanceof(zul.inp.Textbox) && wgt.$n().value != wgt.getText()) zAu.send(new zk.Event(zk.Widget.$(wgt), 'onChange',{"value":wgt.$n().value})); + else if (wgt.$instanceof(ckez.CKeditor)){ + // CKEditor extend from zul.Widget not from wget zul.inp.InputWidget + // so some behavior is not same standard input + // this code bring from ckez.CKeditor.onBlur + var editor = wgt._editor; + + if (wgt._tidChg) { + clearInterval(wgt._tidChg); + wgt._tidChg = null; + } + + if (!editor.document) + editor.document = editor.element.getDocument(); + + if (wgt.$class._checkEditorDirty(editor)) { // Issue #13 + var val = editor.getData(); + wgt._value = val; //save for onRestore + //ZKCK-16, 17 use sendAhead to make sure onChange always happens first + wgt.fire('onChange', {value: val}); + editor.resetDirty(); + } + } }, fireOnInitEdit: function (wgt) {