<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk> <window title="new page title" border="normal" id="inp" ctrlKeys="^a^s^d#f8" attribute name="onOK"><![CDATA[ Messagebox.show("ENTER key is pressed", "OK", Messagebox.OK, Messagebox.EXCLAMATION); self.focus(); ]]></attribute> <attribute name="onCancel"><![CDATA[ Messagebox.show("ESC key is pressed", "CANCEL", Messagebox.OK, Messagebox.EXCLAMATION); self.focus(); ]]></attribute> <attribute name="onCtrlKey"><![CDATA[ int keyCode = ((KeyEvent) event).getKeyCode(); System.out.println(keyCode); String s = ""; switch(keyCode){ case 65: s = "Ctrl+A";break; case 119: s = "F8";break; case 83:s="Ctrl+S";break; case 68:s="Ctrl+D";break; } Messagebox.show(s+" is pressed", "CtrlKey", Messagebox.OK, Messagebox.EXCLAMATION); inp.focus(); ]]></attribute> </window> </zk>
This blog is dedicated to ZK Framework which is a Ajax based framework and you can make application with the help of MVC and MVVM Framework.
Monday, February 4, 2013
ZK KeyStroke event with Windows Component in ZUL
ZK provide KeyStroke event we can see how can we add these KeyStroke event with windows in ZUL..
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment