Article: Domino AJaX jumpstart »
FERDY CHRISTANT - JAN 6, 2006 (11:28:17 AM)
Introduction
So by now you have heard of this exciting new web development technology called AJaX. Conceptually, you know what it is, and you feel it is time to try this out in Lotus Domino. Instead of trying to understand an advanced code example that is hard to integrate in your own code, you just want some basic hello-world-style examples that you can extend to your own needs. If this is the case, this article will help you.
The demo database
You can either download the database that contains the code, or try it out online:
Basics
AJaX is typically used in one of the following ways:
- GET: Updating a web page based on remote (XML) data without refreshing the page
- POST: Submitting data to a web server without refreshing the current web page
This article will focus on the GET scenario. In this scenario, typically the following flow of events occurs:
- Users opens the web page
- User triggers an event on the page that requires the loading of remote data.
- The remote data is retrieved, meanwhile, the user can continue using the page
- The received XML is parsed
- The parsed result is served to the user without refreshing the page
The demo database delivers four tests that facilitate this flow:
- Get all XML (Synchonous). This test receives the full remote XML file and outputs it in a messagebox to the user. This is done synchronously, meaning that the browser waits until the XML is received successfully.
- Get all XML (Asynchonous). This test receives the full remote XML file and outputs it in a messagebox to the user. This is done asynchronously, meaning that the browser continues processing while the XML is being received in the background.
- Get piece of XML. This test receives the full XML, parses it, and outputs the parsed results in a messagebox.
- Get XML and update page. This test receives the full XML, parses it, and outputs the result by updating the current page without refreshing it.
If you have downloaded the demo database, you can run the test above by opening the "ajaxget" form in your browser.
Implementation
The implementation of the demo database is quite straightforward, yet here are some details:
The XML that we are using in the test is contained in the page test.xml. Note that the content type of this page is set to application/xml.
When you develop AJaX solutions, the XMLHttpRequest object is crucial. Browser inconsistencies make using this object quite tedious in some cases. Luckily, there is a javascript framework that hides this complexity: Sarissa. Sarissa is used in all of the example code in the database. To make it available to the calling code, the "sarissa.js" javascript library is stored as a file resource design element in the database.
The "ajaxget" form contains all the test logic. In the HTML Head Content section, the reference to the Sarissa library is made. The four tests we described above are implemented as buttons. Click on each button on the form to see the code behind it. This is the most interesting part of the demo database, because you can reuse these pieces of example code for your own implementations. Finally, an HTML div section is placed on the test form, this is the location of the output of test number 4.
Conclusion
I hope that this little article and the demo database helps you in getting started with using AJaX technology in Domino. There are many resources that deal with this subject into much more detail, but sometimes it is good to get a bare working example from which you can move on.
Resources
The list of AJaX resources seems to be endless, but I always remember only one:
This is a Wiki that contains tons of great links to AJaX resources, including valuable contributions of fellow Lotus bloggers.


Comments: 35
Reviews: 7
Average rating:
Highest rating: 5
Lowest rating: 4
COMMENT: KANNAPPAN
JUL 10, 05:40:12 AM
COMMENT: LUC BETBEDER

AUG 22, 10:25:09 AM
Nice example db - learnt a lot while unpacking it and using sarissa.
Have one prob with IE ...
In my site I am making a call to a separate db to get my XML from a view using readviewentries ... I simply grab the - easy but...
When I go to this (web)page using HTTPS then the lookup fails (access denied).
BUT It works if I am on the page using HTTP and works both ways HTTP and HTTPS when in Firefox.
Have been looking for a fix all day and only posting this in case you have a simple answer for this issue.
Cheers and thanks for posting a DB example. «
COMMENT: SSS
DEC 1, 01:04:22 AM
COMMENT: GIORGIO
DEC 1, 04:13:48 PM
Played with it for a while, as always on my home Mac, it works with Firefox but is broken with the standard Safari browser (2.0.4), error is
Value undefined (result of expression oDomDoc.load) is not object.
The incriminated line is:
oDomDoc.load(document.forms[0].DBPath.value + '/test.xml?openpage');
Any suggestion how to make it work with this browser? Thanks! «
COMMENT: POČASÍ

DEC 6, 15:16:13
COMMENT: RAJU J

JAN 29, 09:27:46 AM
Will make persons grow more....
Thank You!!
«
COMMENT: ERIK
APR 3, 06:48:31 P.M.
COMMENT: DURAIPANDI


MAY 2, 08:22:24 AM
COMMENT: PATRICK KWINTEN

AUG 16, 07:47:50
Maybe a bit late posting (so I wonder if you will ever read it) but I have been gooogling for a good explanation/tutorial how you should implement the best known javascripts libraries in Notes/Domino and use them in your application development.
Maybe a suggestion for a great new article?
COMMENT: TOM
OCT 19, 05:37:33 PM
COMMENT: ROOT123

NOV 3, 07:15:01 AM
COMMENT: SOHBET

NOV 5, 19:19:03
COMMENT: SOHBET

NOV 17, 02:59:38
COMMENT: SOHBET

NOV 26, 11:57:01
COMMENT: SOHBET ODALARI

DEC 5, 11:32:27
COMMENT: OYUN

JAN 25, 2008 - 00:05:49
http://www.oyunambari.com «
COMMENT: AŞK ŞIIRLERI

FEB 10, 2008 - 15:26:09
COMMENT: DIZI IZLE

FEB 18, 2008 - 03:41:05
COMMENT: KALE KASA

FEB 18, 2008 - 10:58:33
COMMENT: KALE KAPI

MAR 24, 2008 - 00:29:43
COMMENT: DIZI IZLE

MAR 28, 2008 - 17:28:43
COMMENT: NONO
MAR 31, 2008 - 18:15:37
COMMENT: XPERT

APR 3, 2008 - 18:57:28
COMMENT: OYUNLAR

APR 4, 2008 - 09:17:28
COMMENT: DIZI IZLE

APR 10, 2008 - 23:30:23
COMMENT: VENUGOPAL REDDY

APR 14, 2008 - 08:10:54 AM
COMMENT: DIZI IZLE

APR 22, 2008 - 18:44:20
COMMENT: KALE X10

MAY 14, 2008 - 15:32:43
COMMENT: VIDEO IZLE

MAY 20, 2008 - 21:43:10
Will make persons grow more.... «
COMMENT: SOHBET

MAY 31, 2008 - 21:23:17
COMMENT: JEFF

JUN 9, 2008 - 10:58:57
COMMENT: CENGIZ ÖZDEMIR

JUN 14, 2008 - 00:00:14
Nice example db - learnt a lot while unpacking it and using sarissa.
Have one prob with IE ...
In my site I am making a call to a separate db to get my XML from a view using readviewentries ... I simply grab the - easy but...
When I go to this (web)page using HTTPS then the lookup fails (access denied).
BUT It works if I am on the page using HTTP and works both ways HTTP and HTTPS when in Firefox.
Have been looking for a fix all day and only posting this in case you have a simple answer for this issue.
Cheers and thanks for posting a DB example. « «
COMMENT: AŞK ŞIIRLERI

JUN 14, 2008 - 20:12:09
COMMENT: BILLIGFLÜGE

JUN 17, 2008 - 22:38:07
COMMENT: SOHBET


JUN 22, 2008 - 22:56:43