Products Downloads


French version


 

The term AJAX (Asynchronous Javascript And XML) refers to a Web technique that creates asynchronous Web applications using Javascript in combination with an XHTML page's document object model (or DOM) and the XMLHttpRequest object.

Using this technique, the browser-based user interface is able to interact with the Web server to update certain parts of a Web page without completely reloading it.

By reducing the amount of data exchanged between the browser and the Web server, this technique cuts waiting times, making the user interface more interactive and therefore more like an office application.

 

Adelia Web AJAX applications can be used with the following Web browsers: Internet Explorer (version 5 or later), Firefox (version 1.0 or later) and Netscape (version 6 or later).

The Windows CE platform is not supported.

 

Updating an Adelia Web page

Using AJAX, the graphical components of a page can be updated automatically when an Adelia AJAX event is processed. All properties of Adelia Web graphical objects are supported.

A graphical object is updated:

  •  when one of its properties is changed in the 4GL source code,
  •  when one of its methods (modifying its appearance) is called in the 4GL,
  •  when a 4GL instruction that modifies its appearance is called, such as a list-handling instruction in the case of a LIST or TABLE LIST object,
  •  when the FORCE_REFRESH 4GL method is called.

In addition, it is possible to define a Refresh Area object in the page's XHTML template, containing multiple graphical components to be updated. This object is refreshed when the FORCE_REFRESH 4GL method is called.

 

Adelia AJAX event

An event processing block is only executed in AJAX mode if it belongs to an AJAX event. An AJAX event is a special variant of an ::ADELIA_EVT, ::ADELIA_EVT_NOVALID, ::ADELIA_ROLLUP, ::ADELIA_ROLLDOWN or ::ADELIA_EVT_UPL event. It is defined in the usual way in the page layout manager (see the Inserting a Button object section, for example).

The user retains control over the application when an AJAX event is triggered. The application therefore remains receptive to other events. Any new events are queued and executed when the application server has finished processing the current event.

 

An AJAX event differs from a conventional Adelia event in the following respects:

  •  Asynchronous: An asynchronous event does not block the user interface. The interface continues to respond while the event is processed on the Web application server,
  •  Behavior: Defines the strategy followed if simultaneous requests to execute two identical events are received.
  •  Priority: Defines an event's priority relative to other events in the queue.
  •  Invisible: Hides the progress bar when this event is triggered.
  •  Timer: Defines the wait time between successive executions of a cyclical event.

 

Click here for more information on Adelia event processing blocks.

 

4GL instructions in AJAX mode

Certain instructions can be used to trigger a process in AJAX mode:

  • The SFTKEY *AJAX instruction runs a process in AJAX mode,
  •  The PROCESS_PGM *BACK_AJAX (with *POPUP or *POPUP_MODAL) processes a page's BACK block in AJAX mode.

The following instructions, however, refresh the complete page in the same way as a non-AJAX page, even if they are placed in an AJAX processing block: PROCESS, PROCESS_PGM (other than *POPUP or *POPUP_MODAL) and PROCESS_URL.

 

Configuring AJAX mode

AJAX mode is configured using the AWSAjax.properties and AWSAjaxLabels.properties files:

  •  AWSAjax.properties contains the parameters used by the AJAX engine for event processing and HTTP error management, and to determine the appearance of event progress bars.
  •  AWSAjaxLabels.properties can be used to outsource the text messages used by the AJAX mode in a particular language.

For more information on configuring AJAX mode, see the section on Parameters of the AWSAjax.properties file.

 

Using Ajax mode in a Web client program
  • If the Web application runs in Websphere version 5.1 or 6.0, set the "Class loader mode" general property in the application's Websphere setup to PARENT_LAST rather than PARENT_FIRST.
    No action is required for version 6.1 and later.

 

  • If the application runs with a version of Tomcat that uses JDK 1.4 (in principle, Tomcat version 4.1.x or 5.0.x):
    • If Tomcat is run as a Windows service, or by startup.bat, copy the files xercesImpl.jar and xml-apis.jar located in "%ADELIWS%\JDK\jre\lib\endorsed" on your development workstation to Tomcat's "common\endorsed" subfolder.
    • If Tomcat is run by the "Start Tomcat" startup shortcut (or the menu option) (via bootstrap.jar):
    • either specify the directive -Djava.endorsed.dirs="%ADELIWS%\JDK\jre\lib\endorsed" in your Java run command,
    • or else create an "endorsed" subfolder in the "lib" folder of your JRE, into which the files xercesImpl.jar and xml-apis.jar located in "%ADELIWS%\JDK\jre\lib\endorsed" on your development workstation can be copied.

 

 

 

↑ Top of page

  • Aucune étiquette