-
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 #23 from hanhsu/B-ZKCK-14
Bug ZKCK-14: Get ckeditor value within client onChange event return empt...
- Loading branch information
Showing
5 changed files
with
123 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
B-ZKCK-14.zul | ||
Purpose: | ||
Description: | ||
History: | ||
Fri, Feb 06, 2015 5:59:12 PM, Created by hanhsu | ||
Copyright (C) Potix Corporation. All Rights Reserved. | ||
--> | ||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?> | ||
<zk xmlns:w="client"> | ||
<script><![CDATA[ | ||
function fillTextboxFromCkEditor() { | ||
var wgt = zk.Widget.$('$ckeditor'), | ||
textbox = zk.Widget.$('$textbox'); | ||
console.log(wgt.getValue()); | ||
textbox.setValue(wgt.getValue()); | ||
} | ||
]]></script> | ||
<window border="normal" title="hello" id="window" | ||
apply="org.zkoss.zktest.test2.B_ZKCK_14_Composer"> | ||
<vlayout> | ||
<label multiline="true"> | ||
1. type TITLE in the title input box | ||
2. type TEST in the editor | ||
3. Click your mouse once on outside of the editor | ||
4. You should see "<p>TEST</p>" in the button text input box | ||
</label> | ||
<label value="title" /> | ||
<textbox visible="true" value="@{window$composer.instruction.title}" /> | ||
<label value="content" /> | ||
<ckeditor id="ckeditor" value="@{window$composer.instructionText}" w:onChange="fillTextboxFromCkEditor()" /> | ||
<label value="invisibleContent" /> | ||
<textbox id="textbox" value="@{window$composer.instruction.text}" /> | ||
<button label="SAVE" id="saveButton" /> | ||
</vlayout> | ||
</window> | ||
</zk> |
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
74 changes: 74 additions & 0 deletions
74
test/addon/ckeztest/src/org/zkoss/zktest/test2/B_ZKCK_14_Composer.java
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* B_ZKCK_14_Composer.java | ||
Purpose: | ||
Description: | ||
History: | ||
Fri, Feb 06, 2015 6:00:38 PM, Created by Han | ||
Copyright (C) Potix Corporation. All Rights Reserved. | ||
This program is distributed under LGPL Version 2.1 in the hope that | ||
it will be useful, but WITHOUT ANY WARRANTY. | ||
*/ | ||
package org.zkoss.zktest.test2; | ||
|
||
import org.zkoss.zk.ui.Component; | ||
import org.zkoss.zk.ui.util.GenericForwardComposer; | ||
|
||
/** | ||
* | ||
* @author Han | ||
*/ | ||
public class B_ZKCK_14_Composer extends GenericForwardComposer<Component> { | ||
|
||
private static final long serialVersionUID = 595477172241551647L; | ||
|
||
private String instructionText; | ||
|
||
private Instruction instruction; | ||
|
||
public Instruction getInstruction() { | ||
return this.instruction; | ||
} | ||
|
||
public void setInstruction(final Instruction instruction) { | ||
this.instruction = instruction; | ||
} | ||
|
||
public String getInstructionText() { | ||
return this.instructionText; | ||
} | ||
|
||
public void setInstructionText(final String instructionText) { | ||
this.instructionText = instructionText; | ||
} | ||
|
||
public class Instruction { | ||
private String text; | ||
private String title; | ||
|
||
public String getText() { | ||
return this.text; | ||
} | ||
|
||
public void setText(final String text) { | ||
this.text = text; | ||
} | ||
|
||
public String getTitle() { | ||
return this.title; | ||
} | ||
|
||
public void setTitle(final String title) { | ||
this.title = title; | ||
} | ||
} | ||
|
||
@Override | ||
public void doAfterCompose(Component comp) throws Exception { | ||
this.instructionText = null; | ||
this.instruction = new Instruction(); | ||
} | ||
} |
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