ZK. Ajax but no JavaScript. Tom M. Yeh. Founder, the ZK project >No client installation and upgrade . >ZK is an open-source Ajax Web framework that. Read Online or Download ZK: Ajax without the Javascript Framework (FirstPress) PDF. Similar javascript books. Beginning Android Web Apps Development. ZK. Ajax without the Javascript Framework. Authors: Chen, Henri, Cheng, Amy DRM-free; Included format: PDF; ebooks can be used on all reading devices.

Zk Ajax Without The Javascript Framework Pdf

Language:English, German, French
Published (Last):23.06.2016
ePub File Size:27.32 MB
PDF File Size:12.17 MB
Distribution:Free* [*Sign up for free]
Uploaded by: LUCRECIA

ZK , AJAX framework without Javascript, released News: ZK , AJAX framework without Javascript, released. Pdf Free eBooks Download: EBook Pdf ZK. Apress, Inc., is not affiliated with Sun Microsystems, Inc., and this book was written without endorsement from Sun Microsystems, Inc. ZK™ and all ZK-based . ZK. Ajax without the Javascript Framework. ▷ First book on ZK Ajax framework. ▷ Written by co-founder/project lead of open source SourgeForge ZK. ▷ Examples-driven book with This firstPress book (PDF. eBook with Print on Demand.

With starting Android net Apps improvement, you'll how one can observe HTML5, CSS3, JavaScript, Ajax and different internet criteria to be used at the Android cellular platform, by means of construction a number of enjoyable and visually stimulating video games and different internet purposes! Apps are on the middle of home windows eight, bringing wealthy and fascinating studies to either pill and computing device clients.

Ruby in a Nutshell: Ruby is a completely natural object-oriented scripting language written in C and designed with Perl and Python services in brain. The aim of Yukihiro Matsumoto, author of Ruby and writer of this booklet, is to include the strengths of languages like Perl, Python, Lisp and Smalltalk. Erlang Programming: A Concurrent Approach to Software Development. This ebook is an in-depth creation to Erlang, a programming language excellent for any state of affairs the place concurrency, fault tolerance, and quickly reaction is vital.

Erlang is gaining common adoption with the arrival of multi-core processors and their new scalable method of concurrency. With this advisor you will tips on how to write advanced concurrent courses in Erlang, despite your programming historical past or adventure.

Chen firstPress: The several steps in this phase are as follows: For each element, the ZK loader examines the if and unless attributes to decide whether they are true. Unlike most other Ajax frameworks, ZK does not require you to have any knowledge of JavaScript to develop Ajax-based web applications, since the ZK engine auto-generates the JavaScript code. Let s look at ZK s Live Demo web page to experience the magic of ZK This live demonstration explores various examples of ZK components that are built with Ajax and provides an online programming experience.

You can modify the source code of each example online and see the results immediately. Look at the Chart example shown on the left in Figure ; the distribution of the pie chart will be updated automatically when you change the values of the programming categories. In the Drag and Drop component example, shown on the right in Figure , the sequence of each row will be reordered after dropping the dragged row onto the other one.

Figure Live Demo shows how easily you can manipulate ZK components like these two. ZK Ajax Framework ZK is an event-driven, component-based framework to enable rich user interfaces for web applications. With ZK, you represent your application in feature-rich XUL and XHTML components, and you manipulate them based on events triggered by user activity, as you have probably done for years in desktop applications.

Unlike in most other frameworks, Ajax is a behindthe-scenes technology in ZK. ZK simplifies the development of rich Ajax web applications in the following ways: The event-driven engine brings the intuitive desktop programming model to web developers.

And, of course, the three most important characteristics of the ZK Framework will be introduced: It s a presentation layer tool. It s a server-centric framework. It s has a component-based GUI. The mechanism works like this: 1. The ZK client engine resides on the client side for monitoring JavaScript events queued in the browser.

Note The ZK client engine is composed of a lot of JavaScript that is responsible for receiving events and updating the content of web pages. This process is constantly repeated until the URL is no longer referenced by the user. A Presentation Layer ZK is designed to be as thin as possible, so it focuses only on the presentation tier.

Thus, you can build your web application with familiar technologies without learning new ones. The communication between components is quite complex and requires a lot of JavaScript programming, not to mention the problem of incompatibility among JavaScript and browsers. By contrast, in ZK s solution, all the components are created on the server side, which makes communication between components easier since you can access these components directly on the server side.

Moreover, the way components communicate with each other is event driven, which means interaction can be triggered by a user s activities on the client side or events sent from other components. In short, ZK mirrors the simplicity of developing desktop applications in the development of web applications and gives users more interactivity and more responsiveness.

It is similar to the programming model found in desktop GUI-based applications.

In addition, ZK makes it possible to develop web applications in an environment similar to desktop applications, since all components are also created on the server side. In other words, the relationship among components on the client side and components on server side 20 8 firstpress: What Is the ZK Ajax Framework?

Whenever you alter components running on the server, components on the client side are automatically updated in the browser by the ZK engine. Furthermore, the behavior of UI components is triggered by user activities or events sent from other components, which makes it easy to understand the operation of your web application. If you have not installed any JRE, you should download one from the Sun web site and install it on your computer.

I also suggest that you install the latest JRE version, at least version 5. Install JDK 6. Download the Windows online installation of JDK 6. After downloading the file, double-click the installer s icon.

Then follow the instructions the installer provides to specify the location for installation. Note For operating systems other than Windows, please refer to the online instructions at 22 10 firstpress: Getting Started with ZK Installing the Java Servlet Container The second step is to install a Java servlet container.

I suggest you to install Apache Tomcat, which is one of the most popular servlet containers. Besides, it is pretty easy to install and use. Download the Windows Service Installer apache-tomcat exe at 2. After downloading the file, double-click the icon to start the installation program, and follow the instructions on the screen to finish the installation. Also, remember the name and password of the administrator configured in your Tomcat installation, since you might need them for web application deployment.

Download the ZIP file apache-tomcat zip at 2. Unzip the file anywhere on your computer. Download the latest version of the ZK demo file zk-demo-x. Unzip the file that you downloaded from ZK s web site, and find the file zkdemoall.

Deploy zkdemo-all. Tomcat will handle the rest of work, including unzipping and deploying. Activate the servlet container by clicking Start Programs Apache Tomcat 5. You should see an Apache icon on the Windows icon tray. Rightclick the icon, and select Start Service.

The red square on the icon turns green when Tomcat has been activated successfully. To test the deployment, open your browser, and visit or the HTTP port can be omitted if your HTTP port is 80 , and the port number should follow the configuration of your Tomcat. Relative Libraries The zkdemo-all. The following list introduces you to each JAR file and its function: bsh. If you want to build your own ZK application, you have to properly set up the following configurations regarding servlets, listeners, and a filter in the file web.

Understanding Ajax Using Javascript To Create Rich Internet Applications

Listing shows an example web. The ZK web. For richlets. The DHTML layout servlet is zkloader, and it s responsible for loading a ZUML page and creating components based on definitions of the page when the servlet container receives requests sent from the browser.

I want to caution you that the update-uri URI of zkloader must follow the url-pattern URL of auengine, or your web application will not work properly.

A richlet is a small Java program that creates all the components necessary to respond to a user s request. However, richlets are designed especially for developers who have a deep understanding of ZK, since the developer has to decide how components should be constructed.

In addition, in order to distinguish pages created by richlets from those created with ZMUL, you need to define a new URL pattern for the ZK loader to hand over a user s request to the specified richlet. Moreover, to specify the richlet to use for requests from a certain URL, you need to configure it in the zk.

We ll look at how to do that in the next section. Configuring zk. Listing demonstrates the configurations for a richlet for a web page s session timeout. Listing In the example of zkdemo-all. If the value is left blank, the browser will reload the same URL.

Summary The environment for running ZK web applications is pretty much the same as for running any other servlet application. Building your own ZK web application requires a little bit more effort you need to set up the necessary configurations in web. However, you can always just copy the web. In fact, this is always how I start a new ZK web application project.

We ll create the simplest, but most famous, program: Hello World. In addition, you will see how easy it is to customize a ZK component with its properties, as well as a demonstration of Ajax in ZK, and I ll explain its concept of behind-the-scenes technology. Now, follow the instructions in this chapter to complete your first mission! In this section, I ll explain how to build this application step by step.

Use a text editor program or any kind of integrated development environment IDE to open this file. Instructions for installing Eclipse are included in Chapter Fill in this file with the content shown in Listing Activate your Tomcat server.

Stay ahead with the world's most comprehensive technology and business learning platform.

Your screen should look like the one shown in Figure You have finished your first ZK application. The previous example introduced the first ZK component window.

Now, I am going to introduce you to how to customize the window component using its basic properties. Table shows some of its properties. Table Start with the example in Listing to help you follow along with the example, the properties are in bold. You can now use your mouse to adjust the size of this window by clicking and dragging its lower right corner. The result is shown in Figure Moreover, if you mouse over the upper right corner of this window, a square, white iconwitharedx appears, as shown in Figure , and if you click the icon, the window will close.

Zk ajax without the javascript framework pdf

A closable window But, you might argue, This is not an Ajax application. There is no interactivity. Yes, at the moment, myhello. So let s do some enhancement with Ajax. Please add the bold code in Listing to myhello. Define an id for the window component. Create a button by declaring a button component in myhello. Note A label component represents a piece of text. It can be created alone or attached to other components as a property. Register an onclick event listener in the button component, which triggers an onclick event when this button is clicked.

Put the following line within double quotes in the onclick event listener to define the command when the onclick event is triggered: win. Note Since a.

Reload myhello. The title of the window has changed. The behind-the-scenes workings of this example are illustrated in Figure Flowchart of Ajax in ZK Here s what s happening behind the scenes: 1. A user clicks the change title button. A JavaScript onclick event is triggered. The ZK client engine catches this event.

ZK AU engine on the server side receives the command sent by the ZK client engine and sends an onclick event to the server-side onclick event listener registered in the button component. The onclick event listener notifies the AU engine that its execution has finished.

They deliver events happening in the browser to the application running at the server and update the DOM tree at the browser based on how components are manipulated by the application. Summary After reading the step-by-step guidelines in this chapter, you should be able to develop a simple ZK application. This chapter s example demonstrates two important characteristics of ZK: it s component-based and event-driven.

Using ZUML, you can change the look or behavior of components by simply adding or editing their properties. This chapter also provided a simple example with Ajax technology in which the title of a window in a web page is changed when the user clicks the button within that window.

The behind-the-scenes technology is handled by the ZK client and AU engines, and no JavaScript knowledge is required to write the Ajax application. In the next chapter, I will introduce more ZK components to you, and of course, you ll get to practice more with Ajax.

In this chapter, I will discuss the basic concepts of the ZK Ajax Framework in more detail, which will prepare you to create the real application in Part 2 of this book. Components, Pages, and Desktops A component is a user interface UI object, such as a label, a button, or a tree.

It defines the visual representation and behaviors of a particular user interface element. Bymodifyingthe component itself or manipulating the component structure, you can control to the visual representation of an application in the client. All ZK component implements the org.

A page is a collection of components. Pages are members of the org. As a ZK application interacts with user, components might be added to a page, and some might be removed from the page. Adesktop ofclassorg. Desktop is a collection of pages for serving the same URL request. As a ZK application interacts with user, pages might be added to a desktop, and some might be removed from a desktop. Note A component is of two worlds.

Besides being a Java object on the server, a component has a visual part in the browser when it belongs to a page. That is, when a component is attached to a page, its visual part is created in the browser. When a component is detached from a page, its visual part is removed.

In this section, we ll look at the life cycle of ZK components so that you have a better understanding of the mechanism of ZK framework.

Page initialization 2. Component creation 3. Event processing 4. If no such processing instructions are defined, this phase is skipped. What the class will do, of course, depends on your application requirements.

Then, the zscript file will be interpreted at the Page Initial phase. Note The page is not yet attached to the desktop when the page initialization phase executes. The several steps in this phase are as follows: 1. For each element, the ZK loader examines the if and unless attributes to decide whether they are true. If not, the element and all of its child elements are ignored.

If the foreach attribute is specified with a collection of items, ZK performs steps 3 7 for each item in the collection. The ZK loader creates a component based on the element name or the class specified in the use attribute, if any.

The members of the component s class are initialized one by one in the order that attributes are specified in the ZUML page. The ZK loader interprets any nested elements and repeats the whole procedure. The loader invokes the aftercompose method if the component implements the org. After all children are created, the oncreate event is sent to this component, so that the application can initialize the content of additional elements later.

The oncreate events are posted for child components first. The Event Processing Phase In the event processing phase, ZK invokes each listener for each event queued for the desktop one by one.In this thread an event listener is processed.

Ajax Without JavaScript Framework HENRI CHEN AND ROBBIE CHENG

You should see New File Type dialog box pop up. To control this phase, it is possible to define a class or zscript for that phase. Introducing the Versatile ZK Components The foreach Attribute The foreach attribute is used to determine how many components will be created.

As a result, the problem of identifier conflict is resolved by using ID spaces to divide a ZUML page into a number of zones, like folders. Select Properties as shown in Figure You should see the Properties dialog box for zcommon.