|Language:||English, Spanish, German|
|Genre:||Fiction & Literature|
|ePub File Size:||26.66 MB|
|PDF File Size:||17.18 MB|
|Distribution:||Free* [*Register to download]|
A very large and comprehensive widget library that was available only in commercial Ajax toolkits is now available to the open source community. Download the entire source tree to find the Ajax directory, which includes example applications. Pros: Full support of drag-and-drop in all widgets.
Widgets include data list, wizard, button, text node, rich text editor, tree, menus, etc. Very strong client-side MVC architecture based; architect is ex-Javasoft lead developer. Strong multibrowser capabilities: IE 5. High-quality widgets have commercial quality, since this is a commercial open source product. Widget library is available as a separate build target set from the main product. Debugging facility is built into the library and displays communications request and response.
They carry with them the experiences and memories of different spaces and their art. Anniversary in. Indian painting - Wikipedia, the free encyclopedia Around 1st century BC the Sadanga or Six Limbs of Indian Painting, were evolved, a series of canons laying down the main.
Allen True in. Save on Popular Books. Women, Motorcycles and the Road to Empowerment is her first book. She has been a popular essayist for the Mainichi newspapers and other publications since Japan; Spain; United Kingdom;.
Since Japan is a. Synopsis: Women. Courtesy of VH1. Insiders' Guide. Auto dealers in the Philadelphia District attributed the strong sales in New Jersey to the continued effect of Hurricane Sandy. The city is not only famous for its awe-inspiring architecture, but also as the.
The police scuffle happened last night on where else? Paula Deen sees book pre-sales skyrocket. Memphis Medical Monthly, Memphis, Tenn. Send me monthly emails about Learning Difficulties.
Memphis Medical Monthly. See other formats. Memphis Medical Secretary. High School. New York: V. Remember, not all potatoes can swim; always keep plenty of ice cream available and do not run with sharp objects in your hands. These indicators are given greater weight than others in the estimation of. Action Comics No.
These countries are given greater weight than others in the. A Revolution in Creative Business Strategy. Headquarters 45 Aileron Ct. A Taste of China. You've come to the right place to enjoy a good book and bedtime story,. HarperCollins Publishers, , 64 pages. The suggested age range for this book is , though I. Read Me A Book We love reading and you can too! Hear today's narrated book, listen to the letter, vocabulary, and sounds of the day, hear a weekly chapter book Par deloney chelsey le dimanche, juillet 7 , Indian Survival on the California Frontier The Lamar Series in Western History book download Albert L.
The Lamar Series in.
Indian Survival on the California Frontier. Though it is a history book. I bought this book for a California History class,. Like many concepts in the book world, "series" is a. A Theory of Socialism and Capitalism has. Apache implementation for uploading files. Getting Started with ZK commons-io. Dojo Ajax toolkit related components fckez. Google Maps related components zcommon.
The common library for ZK zhtml. XHTML-related components zk. ZK kernel code zkplus. Acegi Security, Spring, Hibernate, and data binding integration codes zul. XUL-related components zweb. Web-related utility codes Configuring web. 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.
Listing shows an example web. Listing 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.
Listing demonstrates the configurations for a richlet for a web page s session timeout. 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!
Your First ZK Application: 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. Your screen should look like the one shown in Figure Window Congratulations! 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. 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.
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: 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.
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: 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. An independent thread is started to invoke each listener, so it can be suspended without affecting the processing of other events. Note During processing, an event listener might fire other events. To render a component, the redraw method is called.
Note The redraw method will not alter any content of the component. Request processing 2. Event processing 3. Therefore, requests for the same desktop are processed sequentially. Requests for different desktops are processed in parallel. The Request Processing Phase Depending on the specifications in the request, the ZK AU engine might update the content of affected components so that their content is the same as what is shown on the client.
Then, it posts corresponding events to the queue. It processes events one by one and uses an independent thread for each. Then, the client engine updates the DOM tree at the browser based on the responses. Whether you re redrawing the whole visual representation of a component or updating an attribute at the browser depends on the implementation of components.
As the component developer, it s up to you to balance interactivity and simplicity in deciding whether to update or redraw. It is shown as soon as it is attached to the page. More precisely, once a component is detached from a page, it is no longer managed by ZK if the application does not keep any reference to it. However, if the application holds a reference to the component, it will not be collected with the garbage. One of the crucial attributes is id, which assigns a identifier to a component.
You can decide whether to create a component or not by specifying the statement in if or unless attributes. And, you can determine how many components will be created using the foreach attribute. Moreover, you can replace the default Java class of a component by assigning another Java class with the use attribute.
In Listing , an identifier "label" is assigned for label so that the ZK engine can identify this label component at the server for manipulating its value. In this statement, self is an implicit object referring to the button component itself, and label references the label component.
If you click the Yes button on the screen, the word Yes should appear in answer to the question Do you like ZK? See Figure If you click the No button, the word Yes will be replaced with No.
Using an id attribute in Java Listing is another example for referencing a component, this time in an EL expression. The string to use for the label that is, the value of label is taken from the source text box the value of textbox with the id of "source".
First of all, declare a textbox component whose id is "source". Next,setthevalue of the label component equal to the value of textbox by using an EL expression to identify the textbox component. If you want to change the string shown on the screen, you could edit the value of textbox in the ZUML page and reload it.
An id attribute example using an EL expression The if and unless Attributes The if and unless attributes are used to define a true-false statement for determining whether to create a component or not. In example shown in Listing , an EL expression is used to determine whether the parameter vote is true or false.
These two labels will be created if the value of vote is true; otherwise, neither of them will be created. If both of these attributes are specified, the component won t be created unless they are both true. The if and unless example. Introducing the Versatile ZK Components The foreach Attribute The foreach attribute is used to determine how many components will be created.
If you specify a collection of objects to this attribute, the ZK loader will create a component for each item in the specified collection. The listitem element will be evaluated three times, and three listitem components "Monday", "Tuesday", and"wednesday" will be generated.
Thus, the previous ZUML page is the same as the following lines: There are two ways to separate code from views. First, you could put these control codes in a separate Java class, and then register event listeners to invoke the proper methods accordingly. For example, you could invoke your methods to initialize or to cancel a process by registering the oncreate , onok , and oncancel event listeners to invoke those methods defined in MyClass class:.
However, a visual representation is usually decomposed into several ZUML pages; for example, you might have a page for a download order and a modal dialog page for the payment terms. If all components are uniquely identifiable in the same desktop, you have to maintain the uniqueness of all identifiers for pages that might be created for that same desktop, which often results in the problem of identifier conflict. ZK has introduced the concept of ID space to deal with this issue.
The space owner is like a file folder, and the fellow components like files within it. In a file system, files with the same name can coexist if they are put in different file folders. In other words, the uniqueness of component identifiers is guaranteed only within the scope of a single ID space. Note A component that implements the org. In addition to resolving the problem of identifier conflict, ID spaces make it easy to refer to a component inside or outside of an ID space by simply invoking the getfellow method.
In addition, there are two ways to retrieve the space owner. One is by invoking the getspaceowner method of fellow components, and the other is by invoking the getfellow spaceownerid method, since the space owner is also a fellow component of this ID space. As a result, there is no hierarchical relationship between the space owner and its fellow components; the space owner is just an identifier in an ID space, like a name of file folder.
Introducing the Versatile ZK Components 41 Getting a Component that s Outside the ID Space It is easy to retrieve any component within another ID space by invoking the getfellow spaceownerid, componentid method, which is much the same as getting a file in a file folder. Listing provides an example illustrating this idea. The window component is a typical space owner. In this example, there must be at least two ID spaces, since there are two window components in this page.
Both of these ID spaces include a label component, and you could have the same identifier labeld for each of these two label components since they are in different ID spaces. 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. A hierarchical relationship does exist between space owners.
A space owner could be a fellow component of another ID space when a space owner is embedded within another ID space. In this example, the "winc" component is a fellow component of "wina" since it is embedded within the ID space of the wina component.
Therefore, if you want to retrieve a component within the ID space of "winc", for example, labeld, you should invoke the getfellow method in the following format: The relationship among these components is illustrated in Figure The relationship among components Note Neither vbox nor label implements the org. In Listing , there are, in fact, a total of three ID spaces two window components, wina and winc, andapage component, page1, which is another kind of space owner: The page1 ID space has wina, vboxf, andlabelg as fellows.
The wina ID space has wina, hboxb, labeld, winc, labele as fellows. The winc ID space has winc and labele as fellows. To make referencing components easier, ZK also provides a Path utility class with which you can access any component within any ID space with an ID space directory format, just like accessing a file within a file system directory.
For example, if you want to get the labeld component of this page, you can call Path. Getting a Component from Another Page Listing builds page2. Then, page1 and page2 form a desktop. For example, to reference labeld of page1 from labeli of page2, you could call this method: Using zscript and EL expressions Though you ve learned how to separate control code from the view, ZK provides a way to declare variables or methods within the ZUML page directly when necessary using the zscript element.
Besides, ZK also supports EL expressions for accessing variables defined within zscript element. Their uses are introduced in the following paragraphs. It is most often used to initialize page or component creation or to declare global functions. Figure shows the result after the button has been clicked three times.
The zscript example after clicking the Say Hello button three times If you prefer to separate code from views, you could put the Java code in a separate file, like sayhello.
SeeListingfor an example. For example, the following expression will be evaluated as a Boolean object: Each type of event is represented by a distinct class. For example, org. To respond to an event, an application must register one or more event listeners to the event. There are three ways to register an event listener to a component. The event handling code for the onclick event is alert "hello World! Introducing the Versatile ZK Components 47 hellobtn. ZUML divides off the dependency of the set of components to use.
However, if two or more types of components are used in the same page; you have to use XML namespaces to distinguish them. Listing shows an example of mixing two types of components. This feature tremendously simplifies web programming in ZK.
To further simplify some common tasks, ZK supports the commonly used message box and file upload dialogs. Messagebox Messagebox that is, org. It is typically used to alert a user when an error occurs or to prompt a user for a decision.
YES Messagebox. NO, Messagebox. Introducing the Versatile ZK Components 49 Since it is common to alert a user of an error, a global function called alert is available for zscript. Thealert function is a shortcut of the show method in the Messagebox class.
For example, the following two statements are equivalent: The get method will show a dialog automatically that prompts the user at the browser for specifying a file for uploading.
It won t return until the user has uploaded a file or clicked the cancel button. OK, Messagebox. In ZK, defining and using macro components takes three steps: Define a macro component using a ZUML page:. Declare the macro component in the page that is going to use it: Use the macro components, which is no different from using other components: Thus, the macro component itself is, by default, an independent ID space in order to avoid the problem of identifier conflict.
To see an example, you could copy Listing into a. It is only effective for the following host: As an example, you could declare a web page with this line: There are numerous buttons for effects to enrich the text. You can type words in the panel, highlight those words, and click any of the buttons to change the look of your words. Listing shows one the most famous uses of Dojo, a fish-eye list which viewing.
Introducing the Versatile ZK Components 53 a list of images with a fisheye zooming in. You could give it a try by creating the page in Listing and mousing over the icons on the screen. A menu using the Dojo fish-eye list feature Summary This chapter has introduced you many tools for building ZK components, as well as to the life cycle of ZUML pages and components and how ZK implements the idea of eventdriven programming.
Though these ideas are easy to understand, ZK makes using them quick and easy too. In the next chapter, I am going to guide you through building your first web application with ZK. Let s see how easy it is.
I will walk through various important parts with a real web application with you and explain why it is implemented that way. Learning by example is always the fastest way to understand a framework. You should follow these steps to set up an environment for developing ZK applications: Install the most recent JDK. Install Tomcat. Set up the. Configure ZK to work with Eclipse. Once your development environment is all set up, I ll introduce you to a few more handy tools for use with the ZK Framework.
The most updated version now is Java SE 6. Remember to write down your Tomcat installation directory the default is C: Though installing Eclipse is not required to use the ZK Framework, having the same development environment as mine may reduce the number of minor errors caused by inconsistencies across development environments.
Use the instructions in the following section to install Eclipse with the WTP. It is easy to install Eclipse: Eclipse WTP includes all the required tools and plug-ins to develop a web application.
Setting Up the Development Environment 59 Specifying the Workspace for Eclipse Before you start using Eclipse, you need to specify the workspace for storing your applications as follows: Double-click the eclipse. The Eclipse icon 3. The Workspace Launcher dialog box will pop up; use it to set up your workspace, which is the place to keep your Java code and configuration files.
I suggest using the suggested directory unless you want to keep your code somewhere else. To make Eclipse work with Tomcat, you need to set up Tomcat as a runtime server for running web applications: From the Eclipse menu, select Window Preferences.
The Preferences dialog window will open; see Figure In the tree menu on the left, select Server Installed Runtimes. Then click the Add button. You should see a New Server Runtime dialog window pop up.
Setting Up the Development Environment Figure In the Preferences dialog box, select Server, followed by Installed Runtime. Setting Up the Development Environment 61 Figure Select your server in the New Server Runtime dialog. Next, select your JRE for example, jre 1. Select your root directory and JRE before clicking Finish. Click the OK button in the Preferences dialog box. Defining a Server Instance After setting up Tomcat as a runtime server, you need to define a server instance of Tomcat to use for deploying web applications: You should see the Show View dialog box pop up.
Setting Up the Development Environment 63 Figure In the Show View dialog box, click Server and then Servers. Under the Servers tab, right-click to show the context menu. Select New Server as shown in Figure You should see the New Server dialog window pop up.
Right-click to display the context menu. In the New Server dialog box shown in Figure , you will define your new server. In the Server s host name field, enter localhost. In the Select the server type field, choose Tomcat v5. Then, in the Server runtime field, select Apache Tomcat v5. Finally, click the Finish button. Specify the details of your server in the New Server dialog box.Essentially, all the plumbing for making Ajax-based web sites, as well as other common scripts.
Here, we have the first use of the use attribute of an element. Acegi Security, Spring, Hibernate, and data binding integration codes zul. User s Guide. Table of contents Table of contents 1 Jargon The onclick event listener notifies the AU engine that its execution has finished.
World Market Indices Currency. The window component is a typical space owner.