AJAX Pages and Functions

Visual LANSA Framework

AJAX Pages and Functions

 

AJAX Pages

An AJAX page is an HTML document. Typically it contains JavaScript to manage interactions between the application server and the user interface.

For example, an HTML page may display a “Search” button on the user interface.

When the user clicks it, JavaScript code (executing on the client PC) assembles a request and sends it to the application server.

The AJAX function (executing on the server) receives the request, processes it, and sends back a response.

The JavaScript code in the AJAX page receives the response and updates the user interface, for example by dynamically displaying a list of customers.  

There are two significant things about this interaction:

  • The request sent to the application server is handled asynchronously. This allows the user and JavaScript to do other things while waiting for the server to respond.
  • The JavaScript typically dynamically rebuilds just part of the user interface (for example a list) rather than rebuilding the entire HTML page or frame from scratch.        

 

AJAX Functions

AJAX functions are normal RDML or RDMLX functions, so they are architecturally different to WAMs. They have no user interface capabilities. There only purpose is to receive information from and return information to AJAX page(s).

The information is received and returned as pure data.

The AJAX page manages how the information is input by, or displayed to, the user. 

 

Where do AJAX pages and functions reside?

AJAX pages reside on your web server, typically in your Framework private folder while you are doing development.

AJAX functions reside on your application server.

Typically your web server and application server are on the same computer.

 

Where do AJAX pages and functions execute?

The JavaScript in AJAX pages execute inside a web browser on a client PC.

The RDML or RDMLX code inside an AJAX function executes on your application server.

Very rarely do your web browser and application server reside on the same computer.  The most notable exception is when you are developing applications using the VL-IDE on your PC and executing them under the IIS web server which is also executing on your PC.