-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from hanhsu/refix-B70-CKEZ-#9
refix Issue #9: unexpected onChange event after setting the value from t...
- Loading branch information
Showing
2 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
<zk> | ||
<zscript> | ||
String myValue = "initial value"; | ||
public updateMyValue(String newValue) { | ||
myValue = newValue; | ||
editor.setValue(myValue); | ||
//Clients.showNotification("updated myValue to: " + myValue); | ||
} | ||
</zscript> | ||
<vlayout> | ||
<button label="1. update editor value to 'abc'" onClick='updateMyValue("<p>abc</p>");' /> | ||
<button label="2. update editor value to 'XYZ'" onClick='updateMyValue("<p>XYZ</p>");' /> | ||
<button label="3. do something unrelated and show 'myvalue'" | ||
onClick='debugLabel.setValue("myValue: " + myValue);' /> | ||
<label id="debugLabel" /> | ||
<ckeditor id="editor" value="${myValue}" onChange='myValue = self.getValue(); alert("changed")' /> | ||
</vlayout> | ||
</zk> | ||
<zk> | ||
<zscript> | ||
String myValue = "initial value"; | ||
public updateMyValue(String newValue) { | ||
myValue = newValue; | ||
editor.setValue(myValue); | ||
//Clients.showNotification("updated myValue to: " + myValue); | ||
} | ||
</zscript> | ||
<vlayout> | ||
<button label="1. update editor value to 'abc'" onClick='updateMyValue("abc");'/> | ||
<button label="2. update editor value to 'XYZ'" onClick='updateMyValue("XYZ");'/> | ||
<button label="1-1 update editor value to 'abc' with p tag" onClick='updateMyValue("<p>abc</p>");' /> | ||
<button label="2-1 update editor value to 'XYZ' with p tag" onClick='updateMyValue("<p>XYZ</p>");' /> | ||
<button label="3. do something unrelated and show 'myvalue'" onClick='debugLabel.setValue("myValue: " + myValue);'/> | ||
<label id="debugLabel"/> | ||
<ckeditor id="editor" value="${myValue}" onChange='myValue = self.getValue(); Clients.showNotification("Triggered onChange");'/> | ||
</vlayout> | ||
</zk> |