{"id":38,"date":"2008-06-18T17:14:51","date_gmt":"2008-06-18T17:14:51","guid":{"rendered":"http:\/\/cyberpen.wordpress.com\/?p=38"},"modified":"2022-10-31T17:53:35","modified_gmt":"2022-10-31T17:53:35","slug":"want-richstunning-web-applications-zk-is-right-for-you","status":"publish","type":"post","link":"https:\/\/www.confianzit.com\/cit-blog\/want-richstunning-web-applications-zk-is-right-for-you\/","title":{"rendered":"Want Rich\/Stunning Web Applications? ZK is right for you !"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;3.22&#8243;][et_pb_row _builder_version=&#8221;4.9.4&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; hover_enabled=&#8221;0&#8243; column_structure=&#8221;3_5,2_5&#8243; sticky_enabled=&#8221;0&#8243;][et_pb_column type=&#8221;3_5&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;4.9.4&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; hover_enabled=&#8221;0&#8243; module_class=&#8221;blog-left-content&#8221; sticky_enabled=&#8221;0&#8243;]<\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-size: x-small;\">The first thing that came to my mind when ever I heard \u201c<a href=\"https:\/\/www.confianzit.com\/web-design-development-company\">Web Application<\/a>\u201d was JSP on front-end. May be I was too used to it or May be too comfortable with it. During that time I had to learn ZK for a project and the result is \u201c<strong>I am totally smitten by it<\/strong>\u201d. The rich GUI experience and easiness of coding really made me blind. This is not a starter tutorial for ZK. The ones provided in their website are too good. I am here to write about some of the note worthy aspects of ZK and some code snippets I believe would be useful for some one. I am still a newbie, So feel free to correct me or add in some valuable comments\/Suggestions.<\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-size: x-small;\">What ZK is?<\/span><\/p>\n<p style=\"margin-bottom: 0;\">\u201c<span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">ZK is an event-driven, component-based framework to enable rich user interfaces for Web<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\" align=\"left\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">applications. \u201d-Definition from the creators itself.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>Some stunning Features of ZK<\/strong><\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><strong>* Rich GUI Experience<\/strong><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><strong>* Ability to Differentiate the Business Logic From Implementation<\/strong><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><strong>* Server Push Technology<\/strong><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><strong>* Internationalization<\/strong><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>Rich GUI Experience<\/strong><\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> Everyone wants a rich GUI experience in their <a href=\"https:\/\/www.confianzit.com\/web-design-development-company\">web applications<\/a>. But the very need shouldn&#8217;t compromise the speed. Putting it in another way, the page should load fast. ZK includes an AJAX-based event-driven engine, a rich set of XUL and XHTML components and a markup language called ZUML (ZK User Interface Markup Language) which is not only easy to use, but also delivers a high quality GUI experience with out compromising speed.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> One of the key aspect of ZK driven projects are the responsiveness of the application. At times you will scratch your head thinking whether its a desktop application!<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>Ability to Differentiate the Business Logic From Implementation<\/strong><\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> This one of the most important feature of ZK. It is easy to isolate the business logic completely from the User Interface. I can explain this with a simple example. I am using ZK to create a login screen which accepts user name &amp; password from the user for authentication. First let me show you the real code and then explain how it works.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">************************************Code**************************************<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\">Login.zul <\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=&#8221;center&#8221;&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;window id=&#8221;login&#8221; Title=&#8221;Login page&#8221; border=&#8221;normal&#8221; <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">width=&#8221;400px&#8221; mode=&#8221;modal&#8221; <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">use=&#8221;cyberpen.web.LoginWindow&#8221;&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;label id=&#8221;errLabel&#8221; style=&#8221;color: red&#8221;\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;grid&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;rows&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=&#8221;right&#8221;&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;label value=&#8221;User Name :&#8221;\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=&#8221;center&#8221;&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;textbox id=&#8221;username&#8221; constraint=&#8221;no empty&#8221;\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> &lt;div align=&#8221;right&#8221;&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;label value=&#8221;Password :&#8221;\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=&#8221;center&#8221;&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;textbox id=&#8221;password&#8221; type=&#8221;password&#8221; constraint=&#8221;no empty&#8221;\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;row spans=&#8221;2&#8243; align=&#8221;center&#8221;&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;button label=&#8221;Login&#8221; onClick=&#8221;login.onLogin()&#8221;\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/rows&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/grid&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/window&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>LoginWindow.java<\/strong><\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">package cyberpen.web;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">import org.zkoss.zul.Textbox;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">import org.zkoss.zul.Window;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">public class LoginWindow extends Window {<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> \/**<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> * <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> *\/<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> private static final long serialVersionUID = 8477939400437670121L;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> public void onLogin(){<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> String User_Name = ((Textbox) getFellow(&#8220;username&#8221;)).getValue();<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> String PassWord= ((Textbox) getFellow(&#8220;password&#8221;)).getValue();<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> }<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">}<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">********************************End Of Code************************************<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Lets see how this works. In the Login.zul file every distinct component has got a unique id. Please note that the id&#8217;s must be unique, if two components have the same id, ZK will throw an error during compilation.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=&#8221;right&#8221;&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;label value=&#8221;User Name :&#8221;\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=&#8221;center&#8221;&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">&lt;textbox id=&#8221;<\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Verdana,sans-serif;\"><strong>username<\/strong><\/span><\/span><span style=\"font-family: Verdana,sans-serif;\">&#8221; constraint=&#8221;no empty&#8221;\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">As you can see the unique id for the textbox that takes the value of UserName is &#8220;<\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Verdana,sans-serif;\"><strong>username<\/strong><\/span><\/span><span style=\"font-family: Verdana,sans-serif;\">&#8221; . And We are getting this value directly in our java program. How is this possible ?<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">We have explicitly given in the Login.zul file that it should use the class \u201c<\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Verdana,sans-serif;\"><strong>cyberpen.web.LoginWindow<\/strong><\/span><\/span><span style=\"font-family: Verdana,sans-serif;\">\u201d<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;window id=&#8221;login&#8221; Title=&#8221;Login page&#8221; border=&#8221;normal&#8221; <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">width=&#8221;400px&#8221; mode=&#8221;modal&#8221; <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">use=&#8221;<\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Verdana,sans-serif;\">cyberpen.web.LoginWindow<\/span><\/span><span style=\"font-family: Verdana,sans-serif;\">&#8220;&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&#8230;&#8230;.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/window&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Please note that full path to the location should be explicitly given. <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Now how are we reading the value from textbox? <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">You can see that the Login Button onClick is mapped to the function \u201clogin.onLogin()\u201d<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;button label=&#8221;Login&#8221; onClick=&#8221;login.onLogin()&#8221;\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">Please note \u201clogin\u201d is the unique id of the window component of our zul page which is asked to use the class \u201c<\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Verdana,sans-serif;\"><strong>cyberpen.web.LoginWindow<\/strong><\/span><\/span><span style=\"font-family: Verdana,sans-serif;\">\u201d and <\/span><span style=\"font-family: Verdana,sans-serif;\"><strong>OnLogin()<\/strong><\/span><span style=\"font-family: Verdana,sans-serif;\"> is the method defined inside this class. <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Now we use ZK&#8217;s getFellow() method to read the value of username and password and store it in seperate variables.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">String userName = ((Textbox) getFellow(&#8220;username&#8221;)).getValue();<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">String passWord= ((Textbox) getFellow(&#8220;password&#8221;)).getValue();<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">where \u201cusername\u201d &amp; \u201cpassword\u201d are the unique id&#8217;s of the textboxes for UserName and Password respectively.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">So whats the exact point?<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">You can give the zul page to a <a href=\"https:\/\/www.confianzit.com\/hire-a-developer\">web designer<\/a> and ask him to decorate it while the underlying logic remains the same. Web designer need not know java or worry about any underlying stuff. Put it in converse, if you want to change the underlying business logic you don&#8217;t need to change anything in the front end.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">This is worry free compared to having a long jsp file with lots of java scripts, and control flowing back and forth. It will be harder to make it and more harder to redesign later.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>Server Push Technology<\/strong><\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"font-size: x-small;\">Server push means to put content from the server to the client actively. See\u00a0<a href=\"https:\/\/www.zkoss.org\/wiki\/ZK%20Developer&#039;s Reference\/Server Push\" target=\"_blank\" rel=\"noopener\">https:\/\/www.zkoss.org\/wiki\/ZK Developer&#8217;s Reference\/Server Push<\/a> for more details. <\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Is it worth Learning?<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">I would say \u201cYES\u201d . At the end of the day, the question is \u201cDid you make something simpler and easy to use\u201d \ud83d\ude42<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">ZK is a sourceforge project that is growing better day by day. See : http:\/\/www.zkoss.org\/<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>Some Improvements required for ZK<\/strong><\/span><\/span><\/span><\/p>\n<ol>\n<li>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">The components needs to appear the same across different browsers. There are lots of hot fixes for some of the known issues please look through the ZK forum. But still there are some problems that I experienced while working on it, especially Mozilla Firefox failing to understand the height=\u201d100%\u201d , width=\u201d100%\u201d attributes.<\/span><\/span><\/p>\n<\/li>\n<\/ol>\n<ol>\n<li>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Paint support is required which is due on the next release.<\/span><\/span><\/p>\n<\/li>\n<\/ol>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Viewer comments\/suggestions are welcome.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\">HTH,<\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\">Anoop Menon<\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><em>Confianz Global Inc. is a leading\u00a0<a href=\"https:\/\/www.confianzit.com\/\">Odoo ERP Development Company in USA<\/a>. Get in touch with us for\u00a0<a href=\"https:\/\/www.confianzit.com\/openerp-customization\">Odoo ERP Customization<\/a>\u00a0&amp;\u00a0<a href=\"https:\/\/www.confianzit.com\/odoo-implementation\">Implementation<\/a>. So<span>\u00a0<\/span><a href=\"https:\/\/www.confianzit.com\/contact-us\">contact Confianz<\/a><span>\u00a0<\/span>today!<\/em><\/p>\n<p>[\/et_pb_text][\/et_pb_column][et_pb_column type=&#8221;2_5&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221; locked=&#8221;off&#8221; global_module=&#8221;2151&#8243;]<\/p>\n<div class=\"blog-floating-form\"><!-- [et_pb_line_break_holder] -->  <\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.confianzit.com\/cit-blog\/want-richstunning-web-applications-zk-is-right-for-you\/#Talk_to_our_experts_now\" title=\"    Talk to our experts now  \">    Talk to our experts now  <\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.confianzit.com\/cit-blog\/want-richstunning-web-applications-zk-is-right-for-you\/#Talk_To_Our_Experts_Now\" title=\"Talk To Our Experts Now\n\t\">Talk To Our Experts Now\n\t<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Talk_to_our_experts_now\"><\/span><!-- [et_pb_line_break_holder] -->    Talk to our experts now<!-- [et_pb_line_break_holder] -->  <span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p><!-- [et_pb_line_break_holder] -->  \n<div class=\"wpcf7 no-js\" id=\"wpcf7-f1888-o1\" lang=\"en-US\" dir=\"ltr\">\n<div class=\"screen-reader-response\"><p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"><\/p> <ul><\/ul><\/div>\n<form action=\"\/cit-blog\/wp-json\/wp\/v2\/posts\/38#wpcf7-f1888-o1\" method=\"post\" class=\"wpcf7-form init\" aria-label=\"Contact form\" novalidate=\"novalidate\" data-status=\"init\">\n<div style=\"display: none;\">\n<input type=\"hidden\" name=\"_wpcf7\" value=\"1888\" \/>\n<input type=\"hidden\" name=\"_wpcf7_version\" value=\"5.8.6\" \/>\n<input type=\"hidden\" name=\"_wpcf7_locale\" value=\"en_US\" \/>\n<input type=\"hidden\" name=\"_wpcf7_unit_tag\" value=\"wpcf7-f1888-o1\" \/>\n<input type=\"hidden\" name=\"_wpcf7_container_post\" value=\"0\" \/>\n<input type=\"hidden\" name=\"_wpcf7_posted_data_hash\" value=\"\" \/>\n<input type=\"hidden\" name=\"_wpcf7_recaptcha_response\" value=\"\" \/>\n<\/div>\n<div class=\"form-block\" style=\"    background: #fff;\">\n\t<h3 style=\"    background: #0C2464;\n    border-bottom: 5px solid #cecece;\n    border-radius: 5px 5px 90px 90px;\n    margin: 0 auto;\n    text-align: center;\n    padding: 20px;\n    color: #fff;    margin-bottom: 15px;\"><span class=\"ez-toc-section\" id=\"Talk_To_Our_Experts_Now\"><\/span><b>Talk To Our Experts Now<\/b>\n\t<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\t<div style=\"padding:20px;\">\n\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"your-name\"><input size=\"40\" class=\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required your-name\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Name\" value=\"\" type=\"text\" name=\"your-name\" \/><\/span>\n\t\t<\/p>\n\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"your-email\"><input size=\"40\" class=\"wpcf7-form-control wpcf7-email wpcf7-validates-as-required wpcf7-text wpcf7-validates-as-email your-email\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Email\" value=\"\" type=\"email\" name=\"your-email\" \/><\/span>\n\t\t<\/p>\n\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"your-number\"><input size=\"40\" class=\"wpcf7-form-control wpcf7-tel wpcf7-validates-as-required wpcf7-text wpcf7-validates-as-tel your-number\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Phone Number\" value=\"\" type=\"tel\" name=\"your-number\" \/><\/span>\n\t\t<\/p>\n\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"message\"><textarea cols=\"40\" rows=\"10\" class=\"wpcf7-form-control wpcf7-textarea wpcf7-validates-as-required form-message\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Message\" name=\"message\"><\/textarea><\/span>\n\t\t<\/p>\n\t<span class=\"wpcf7-form-control-wrap recaptcha\" data-name=\"recaptcha\"><span data-sitekey=\"6LfFkQATAAAAAIYlZ_UH9UozO-OLkpAaWPWx6QtM\" class=\"wpcf7-form-control wpcf7-recaptcha g-recaptcha\"><\/span>\r\n<noscript>\r\n\t<div class=\"grecaptcha-noscript\">\r\n\t\t<iframe loading=\"lazy\" src=\"https:\/\/www.google.com\/recaptcha\/api\/fallback?k=6LfFkQATAAAAAIYlZ_UH9UozO-OLkpAaWPWx6QtM\" frameborder=\"0\" scrolling=\"no\" width=\"310\" height=\"430\">\r\n\t\t<\/iframe>\r\n\t\t<textarea name=\"g-recaptcha-response\" rows=\"3\" cols=\"40\" placeholder=\"reCaptcha Response Here\">\r\n\t\t<\/textarea>\r\n\t<\/div>\r\n<\/noscript>\r\n<\/span>\n\t\t<div class=\"form-buttons\">\n\t\t\t<p><input class=\"wpcf7-form-control wpcf7-submit has-spinner\" type=\"submit\" value=\"Get a free quote\" \/>\n\t\t\t<\/p>\n\t\t<\/div>\n\t<\/div>\n<\/div><div class=\"wpcf7-response-output\" aria-hidden=\"true\"><\/div>\n<\/form>\n<\/div>\n<!-- [et_pb_line_break_holder] --><\/div>\n<p>[\/et_pb_code][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The first thing that came to my mind when ever I heard \u201cWeb Application\u201d was JSP on front-end. May be I was too used to it or May be too comfortable with it. During that time I had to learn ZK for a project and the result is \u201cI am totally smitten by it\u201d. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"<p style=\"margin-bottom: 0;\"><span style=\"font-size: x-small;\">The first thing that came to my mind when ever I heard \u201cWeb Application\u201d was JSP on front-end. May be I was too used to it or May be too comfortable with it. During that time I had to learn ZK for a project and the result is \u201c<strong>I am totally smitten by it<\/strong>\u201d. The rich GUI experience and easiness of coding really made me blind. This is not a starter tutorial for ZK. The ones provided in their website are too good. I am here to write about some of the note worthy aspects of ZK and some code snippets I believe would be useful for some one. I am still a newbie, So feel free to correct me or add in some valuable comments\/Suggestions.<\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-size: x-small;\">What ZK is?<\/span><\/p>\n<p style=\"margin-bottom: 0;\">\u201c<span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">ZK is an event-driven, component-based framework to enable rich user interfaces for Web<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\" align=\"left\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">applications. \u201d-Definition from the creators itself.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>Some stunning Features of ZK<\/strong><\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><strong>* Rich GUI Experience<\/strong><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><strong>* Ability to Differentiate the Business Logic From Implementation<\/strong><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><strong>* Server Push Technology<\/strong><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><strong>* Internationalization<\/strong><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>Rich GUI Experience<\/strong><\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> Everyone wants a rich GUI experience in their web applications. But the very need shouldn't compromise the speed. Putting it in another way, the page should load fast. ZK includes an AJAX-based event-driven engine, a rich set of XUL and XHTML components and a markup language called ZUML (ZK User Interface Markup Language) which is not only easy to use, but also delivers a high quality GUI experience with out compromising speed.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> One of the key aspect of ZK driven projects are the responsiveness of the application. At times you will scratch your head thinking whether its a desktop application!<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>Ability to Differentiate the Business Logic From Implementation<\/strong><\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> This one of the most important feature of ZK. It is easy to isolate the business logic completely from the User Interface. I can explain this with a simple example. I am using ZK to create a login screen which accepts user name &amp; password from the user for authentication. First let me show you the real code and then explain how it works.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">************************************Code**************************************<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\">Login.zul <\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=\"center\"&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;window id=\"login\" Title=\"Login page\" border=\"normal\" <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">width=\"400px\" mode=\"modal\" <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">use=\"cyberpen.web.LoginWindow\"&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;label id=\"errLabel\" style=\"color: red\"\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;grid&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;rows&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=\"right\"&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;label value=\"User Name :\"\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=\"center\"&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;textbox id=\"username\" constraint=\"no empty\"\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> &lt;div align=\"right\"&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;label value=\"Password :\"\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=\"center\"&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;textbox id=\"password\" type=\"password\" constraint=\"no empty\"\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;row spans=\"2\" align=\"center\"&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;button label=\"Login\" onClick=\"login.onLogin()\"\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/rows&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/grid&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/window&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>LoginWindow.java<\/strong><\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">package cyberpen.web;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">import org.zkoss.zul.Textbox;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">import org.zkoss.zul.Window;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">public class LoginWindow extends Window {<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> \/**<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> * <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> *\/<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> private static final long serialVersionUID = 8477939400437670121L;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> public void onLogin(){<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> String User_Name = ((Textbox) getFellow(\"username\")).getValue();<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> String PassWord= ((Textbox) getFellow(\"password\")).getValue();<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"> }<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">}<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">********************************End Of Code************************************<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Lets see how this works. In the Login.zul file every distinct component has got a unique id. Please note that the id's must be unique, if two components have the same id, ZK will throw an error during compilation.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=\"right\"&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;label value=\"User Name :\"\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;div align=\"center\"&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">&lt;textbox id=\"<\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Verdana,sans-serif;\"><strong>username<\/strong><\/span><\/span><span style=\"font-family: Verdana,sans-serif;\">\" constraint=\"no empty\"\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/div&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/row&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">As you can see the unique id for the textbox that takes the value of UserName is \"<\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Verdana,sans-serif;\"><strong>username<\/strong><\/span><\/span><span style=\"font-family: Verdana,sans-serif;\">\" . And We are getting this value directly in our java program. How is this possible ?<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">We have explicitly given in the Login.zul file that it should use the class \u201c<\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Verdana,sans-serif;\"><strong>cyberpen.web.LoginWindow<\/strong><\/span><\/span><span style=\"font-family: Verdana,sans-serif;\">\u201d<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;window id=\"login\" Title=\"Login page\" border=\"normal\" <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">width=\"400px\" mode=\"modal\" <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">use=\"<\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Verdana,sans-serif;\">cyberpen.web.LoginWindow<\/span><\/span><span style=\"font-family: Verdana,sans-serif;\">\"&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">.......<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;\/window&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Please note that full path to the location should be explicitly given. <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Now how are we reading the value from textbox? <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">You can see that the Login Button onClick is mapped to the function \u201clogin.onLogin()\u201d<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">&lt;button label=\"Login\" onClick=\"login.onLogin()\"\/&gt;<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-size: x-small;\"><span style=\"font-family: Verdana,sans-serif;\">Please note \u201clogin\u201d is the unique id of the window component of our zul page which is asked to use the class \u201c<\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Verdana,sans-serif;\"><strong>cyberpen.web.LoginWindow<\/strong><\/span><\/span><span style=\"font-family: Verdana,sans-serif;\">\u201d and <\/span><span style=\"font-family: Verdana,sans-serif;\"><strong>OnLogin()<\/strong><\/span><span style=\"font-family: Verdana,sans-serif;\"> is the method defined inside this class. <\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Now we use ZK's getFellow() method to read the value of username and password and store it in seperate variables.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">String userName = ((Textbox) getFellow(\"username\")).getValue();<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">String passWord= ((Textbox) getFellow(\"password\")).getValue();<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">where \u201cusername\u201d &amp; \u201cpassword\u201d are the unique id's of the textboxes for UserName and Password respectively.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">So whats the exact point?<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">You can give the zul page to a web designer and ask him to decorate it while the underlying logic remains the same. Web designer need not know java or worry about any underlying stuff. Put it in converse, if you want to change the underlying business logic you don't need to change anything in the front end.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">This is worry free compared to having a long jsp file with lots of java scripts, and control flowing back and forth. It will be harder to make it and more harder to redesign later.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>Server Push Technology<\/strong><\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"font-size: x-small;\">Server push means to put content from the server to the client actively. See&nbsp;<a href=\"https:\/\/www.zkoss.org\/wiki\/ZK%20Developer's Reference\/Server Push\" target=\"_blank\">https:\/\/www.zkoss.org\/wiki\/ZK Developer's Reference\/Server Push<\/a> for more details. <\/span><\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Is it worth Learning?<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">I would say \u201cYES\u201d . At the end of the day, the question is \u201cDid you make something simpler and easy to use\u201d :)<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">ZK is a sourceforge project that is growing better day by day. See : http:\/\/www.zkoss.org\/<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\"><span style=\"text-decoration: underline;\"><strong>Some Improvements required for ZK<\/strong><\/span><\/span><\/span><\/p>\n\n<ol>\n \t<li>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">The components needs to appear the same across different browsers. There are lots of hot fixes for some of the known issues please look through the ZK forum. But still there are some problems that I experienced while working on it, especially Mozilla Firefox failing to understand the height=\u201d100%\u201d , width=\u201d100%\u201d attributes.<\/span><\/span><\/p>\n<\/li>\n<\/ol>\n<ol>\n \t<li>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Paint support is required which is due on the next release.<\/span><\/span><\/p>\n<\/li>\n<\/ol>\n<p style=\"margin-bottom: 0; text-decoration: none;\"><span style=\"font-family: Verdana,sans-serif;\"><span style=\"font-size: x-small;\">Viewer comments\/suggestions are welcome.<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\">HTH,<\/p>\n<p style=\"margin-bottom: 0; text-decoration: none;\">Anoop Menon<\/p>","_et_gb_content_width":"","footnotes":""},"categories":[8],"tags":[],"_links":{"self":[{"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/posts\/38"}],"collection":[{"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/comments?post=38"}],"version-history":[{"count":3,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/posts\/38\/revisions"}],"predecessor-version":[{"id":2402,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/posts\/38\/revisions\/2402"}],"wp:attachment":[{"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/media?parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/categories?post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/tags?post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}