-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I'm trying to center a window with a ckeditor but it doesn't work.
The window doesn't have a height specified. Is the ckeditor that have it. I can't set a height to window because ckeditor height is changed by code and window must fit its content.
Here an example
package j1ckl78d$v1;import org.zkoss.zk.ui.*;
import org.zkoss.zk.ui.event.*;
import org.zkoss.zk.ui.util.*;
import org.zkoss.zk.ui.ext.*;
import org.zkoss.zk.au.*;
import org.zkoss.zk.au.out.*;
import org.zkoss.zul.*;public class Test extends GenericForwardComposer{
public Window ventana;
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
ventana.setPosition("center");}
public void onClick$btn(Event e) throws InterruptedException{
ventana.setPosition("center");
}
}
<zk>
<window id="ventana" border="normal" sizable="true" closable="true" width="850px" position="center" title="hello" apply="j1ckl78d$v1.Test">
<ckeditor id="ck" height="320px"/>
<button id="btn" label="click"/>
</window>
</zk>
package j1ckl78d$v1;import org.zkoss.zk.ui.*;
import org.zkoss.zk.ui.event.*;
import org.zkoss.zk.ui.util.*;
import org.zkoss.zk.ui.ext.*;
import org.zkoss.zk.au.*;
import org.zkoss.zk.au.out.*;
import org.zkoss.zul.*;public class TestComposer extends GenericForwardComposer{
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);}
public void onClick$btn(Event e) throws InterruptedException{
Window ventana;
ventana = (Window)Executions.createComponents("test.zul",null,null);
ventana.doModal();
}
}
<zk>
<window border="normal" title="hello" apply="j1ckl78d$v1.TestComposer">
<button id="btn" label="Click Me To Open Centered Window" />
</window>
</zk>
Thank you!
Oops, fiddle doesn't look well...
Here the link: http://zkfiddle.org/sample/1ckl78d/2-Centered-window-with-ckeditor
Hi Neus,
It is timing issue.
You can specify height to window and using vflex in ckez component.
<zk> <window id="ventana" border="normal" sizable="true" closable="true" width="850px" height="350px" position="center" title="hello" apply="forum.Test"> <ckeditor id="ck" vflex="1"/> <button id="btn" label="click to center"/> </window> </zk>
Hi Neus,
Please try using latest version of CKeditor in your local machine, it has some problem on ZK fiddle.
Asked: 2012-05-24 14:55:16 +0800
Seen: 171 times
Last updated: May 30 '12