|
|
|||||
|
Zapatec Zapatec is an Ajax library writing
in JavaScript, with a clear and well commented source code. It includes
lot of examples in good combination with help documentation. Zp incorporates a complete UI of very flexible components (Widgets),
which have complete Ajax support and permit to construct very impressive
user interfaces. The objective is to use the Zapatec in a Delphi/IntraWeb application, with the intention to utilize ZP Ajax techniques to communicate the two worlds. We can call it ZADI. I will suppose than the reader is familiarized with IntraWeb, and know
the Ajax technique purpose. If the reader is good knower of Zapatec then
is phenomenal, but if don’t know about the Zp then maybe is better
if you start for look in http://www.zapatec.com
to know a little bit about the library.
Trick 1) Include the Zapatec library in files directory.
Really is a very "obvious" step, but is the first very simple way to use Ajax in your IW program. You can do easily the first ZADI version by creating a normal Delphi
IW application, coping the Zapatec Ajax library to the /files directory
in the new application. Now, you can try with http://127.0.0.1:8080/files/index.html Then you will see the demo page, and it is served by the IW application.
So really this is the very first Zapatec Ajax Delphi IntraWeb application.
We must find the way of communicates the Zp components with the IntraWeb server. I had talk about the How connect IntraWeb and Ajax, with details from the IntraWeb server perspective. But now, I will talk about the Zapatec possibilities and problems. We can do it in “traditional” way of IntraWeb (a POST command), which refresh the entire screen, or by an Ajax call which interchange partial information. By the moment, we will see the ZpMenu, ZpGrid and ZpForms components.
The objective is to create a complete set of components than facility
the use the Zapatec in a Delphi/IntraWeb application and simplify the
job. zpMenu With zpMenu, we can illustrate the traditional way to communicate with the server. zpMenu is an elegant component to create Menus in Web Pages. Basically, it is build from a list of elements ( <UL> <LI>
) which the component convert in a pretty menu. You can personalice the
menu in a lot of aspects. The way to communicate with the server can be in Ajax, both in the way
to obtain the data to construct the menu and the way to “inform”
to the server the option selected. A zpMenu can be defined as following:
We can see than the link is like:
Is a classic <a> HTML element which references the SubmitClick
function. Really, it is easy to use in a Web Page, but we have a Delphi component to do it more easy to use in a IntraWeb application. TGpZpMenu: Generates a zpMenu, from the classic TmainMenu in our application. It includes some code to render the HTML code. zpGrid In this component, we will see more “complex” aspects in the Zapatec library. zpGrid generates a functional data table, with sort, selection, editing and more…
sourceType: Indicates de type of data transport to obtain de data for the table. In the example “ xml/url” refer to data in XML format obtained in a URL direction setting in source. Here is the great problem, an IntraWeb page communicates with the server by using POST commands in which includes some information needed to locate the component which process the answer. But ZpGrid call to the URL which obtain the data by using GET commands (with no any additional information). Really, the XML support in other Widgets have the same problem, and this is not good for the IW application. To solve the problem, we will use a second trick.
Don’t worry if not understand the line: MakeCallIW is a function which generates the content to pass in the POSTcall. There is other consideration in how to create the correct XML answer in the IntraWeb app, and each Zp component have specifics params and rules, I will explain each one in next articles. Really is not easy to talk about all the problematic, for example its necesary to do each Ajax call after the other ( doubt a IntraWeb limitation in handle simultanius POST commands ), By the moment, we have Delphi IntraWeb components which supports ZpMenu, ZpGrid and ZpForms. The objective is create a complete set of components than facility the use the Zp components in a Delphi/IntraWeb application and simplify the job. We will publish the first demos ASAP.
|
|
|||||||||
|
|
|||||||||||
|
Teléfono: 978-610539 - Fax: 978-610861 -Trav.Agustina Aragón 1,1e 44002 Teruel ( España ).webmaster Copyright © 1997-2004 , [Multi-Informatica Teruel, S.L].La información contenida en este documento está sujeta a modificaciones sin previo aviso. Otros productos u organizaciones mencionadas aquí son marcas comerciales o marcas registradas propiedad de sus respectivas organizaciones o propietarios. |