From 6e417563a07bb012634fefad8cdc60301c134793 Mon Sep 17 00:00:00 2001 From: hanhsu Date: Thu, 16 Oct 2014 04:27:50 +0100 Subject: [PATCH] refix Issue #9: unexpected onChange event after setting the value from the server --- ckez/src/archive/web/js/ckez/CKeditor.js | 4 +- .../ckeztest/src/archive/test2/B70-CKEZ-9.zul | 37 ++++++++++--------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/ckez/src/archive/web/js/ckez/CKeditor.js b/ckez/src/archive/web/js/ckez/CKeditor.js index 7f82505a..c6f205f7 100644 --- a/ckez/src/archive/web/js/ckez/CKeditor.js +++ b/ckez/src/archive/web/js/ckez/CKeditor.js @@ -25,10 +25,10 @@ ckez.CKeditor = zk.$extends(zul.Widget, { var editor = this.getEditor(); if (editor) { editor.setData(v); - // Issue #9: update editor's previousValue if set value from server + // Issue #9 refix: update editor's previousValue if set value from server // to prevent unexpect onChange event if (fromServer) - editor._.previousValue = v; + editor._.previousValue = editor.dataProcessor.toHtml(v); } }], autoHeight: null, diff --git a/test/addon/ckeztest/src/archive/test2/B70-CKEZ-9.zul b/test/addon/ckeztest/src/archive/test2/B70-CKEZ-9.zul index 633a6525..a84f85be 100644 --- a/test/addon/ckeztest/src/archive/test2/B70-CKEZ-9.zul +++ b/test/addon/ckeztest/src/archive/test2/B70-CKEZ-9.zul @@ -1,18 +1,19 @@ - - - String myValue = "initial value"; - public updateMyValue(String newValue) { - myValue = newValue; - editor.setValue(myValue); - //Clients.showNotification("updated myValue to: " + myValue); - } - - -