-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi!!
Can you help me about how to do the event key press (specify enter key) in a textbox.
Thank's.
PD: Sorry but my english is so bad.
I'm not sure . But i found this:
public void onOk$textboxId(){ System.out.println(textboxId.getValue()) }
I found it should be onOK$textboxId, the "K" should be upper case.
My sample code as follow
forum_10652.zul:
<zk>
<window border="normal" apply="post.Composer_10652" id="win" >
<textbox id="textbox1"/>
<textbox id="textbox2"/>
<button id="test" label="tt"/>
</window>
</zk>
Composer_10652.java
package post;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Button;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;
public class Composer_10652 extends GenericForwardComposer {
private Window win;
private Textbox textbox1;
private Textbox textbox2;
private Button test;
public void onClick$test(){
System.out.println("button pressed");
}
public void onOK$win(){
System.out.println("enter pressed in window");
}
public void onOK$textbox1(){
System.out.println("enter pressed in textbox1");
}
public void onOK$textbox2(){
System.out.println("enter pressed in textbox2");
}
}
Asked: 2009-12-15 14:52:18 +0800
Seen: 6,119 times
Last updated: Dec 03 '19