From 6d0c000f7525ab73a28a6d3c24e92f63e657eda5 Mon Sep 17 00:00:00 2001 From: hanhsu Date: Mon, 19 Jan 2015 09:34:58 +0000 Subject: [PATCH] refix B-ZKCK-12: Calling Ckeditor.setValue() within doAfterCompose and button click have different result --- ckez/src/archive/web/js/ckez/CKeditor.js | 4 +- .../ckeztest/src/archive/test2/B-ZKCK-12.zul | 35 ++++-- .../zktest/test2/B_ZKCK_12_Composer.java | 106 +++++++++++++++--- 3 files changed, 118 insertions(+), 27 deletions(-) diff --git a/ckez/src/archive/web/js/ckez/CKeditor.js b/ckez/src/archive/web/js/ckez/CKeditor.js index 8e562ed6..5f2c866d 100644 --- a/ckez/src/archive/web/js/ckez/CKeditor.js +++ b/ckez/src/archive/web/js/ckez/CKeditor.js @@ -26,14 +26,14 @@ ckez.CKeditor = zk.$extends(zul.Widget, { if (editor) { if (fromServer) { // ZKCK-12: need to format the value from server first before set to ckeditor - editor.setData(jq(this.$n('cnt')).html(v).text()); + v = jq(this.$n('cnt')).html(v).text(); + editor.setData(v); // Issue #9: update editor's previousValue if set value from server // to prevent unexpect onChange event editor._.previousValue = editor.dataProcessor.toHtml(v); } else { editor.setData(v); } - } }], autoHeight: null, diff --git a/test/addon/ckeztest/src/archive/test2/B-ZKCK-12.zul b/test/addon/ckeztest/src/archive/test2/B-ZKCK-12.zul index c3fd5e84..1098ce5d 100644 --- a/test/addon/ckeztest/src/archive/test2/B-ZKCK-12.zul +++ b/test/addon/ckeztest/src/archive/test2/B-ZKCK-12.zul @@ -13,15 +13,32 @@ B-ZKCK-12.zul Copyright (C) Potix Corporation. All Rights Reserved. --> + + + + + + + + + + + + + - - - -