Ajax for client-server communication
Documentation
home
This documentation describes the use of Ajax communication for standard Ebase
facilities such as button clicks, hyperlink clicks, immediate validation
requests etc. It does not include Ajax
requests initiated from client-side Javascript added
by the form developer. Ajax
communication can be enabled or disabled by the developer, but cannot be
configured in any other way.
How configured
Ajax
communication between browser clients and the server can be configured via the Form Properties Dialog. The
default setting for new forms is configured using the Designer Preferences
Dialog.
How it works
When Ajax communication is
enabled, Ajax
is used wherever possible when posting data from the browser to the server and
to return Html output to the browser. Only the minimum data representing and
changed controls is sent back to the client on each occasion – this is referred
to as an Incremental Page Refresh for the remainder of this document.
This technique provides significant benefits when the same web page is
redisplayed to the user: the transition is much smoother and the response time
is faster. Smoother transitions provide an enhanced user interface which is
more like a native application.
When Ajax
communication is disabled, a traditional HTTP POST request is sent with each
user request and the entire page is refreshed on each occasion – this is
referred to as a Full Page Refresh for the remainder of this document.
There are many occasions where a Full Page Refresh is required e.g. the application logic routes
control to another page or another form. When these situations are detected,
the initial Ajax
request is processed by the server, then the browser is requested to issue a Full Page Refresh request.
Back Button Considerations
The browser’s history cache (which the browser users for
back button and forward button requests) is not updated when an Incremental Page Refresh is used.
Therefore when Ajax
is used successfully without the need for a Full
Page Refresh, the user will not have the ability to return to the page
before the request was made. Instead, the back button will return the user to
the page resulting from the last Full
Page Refresh. This situation will usually apply when the same page is
redisplayed.
Use of JSPs with Ajax
When JSP are HTML files are configured on a page, either as
top, left, right or bottom JSPs or in an Include Control, these are refreshed according
to the setting of the static flag for
each JSP or for the control: when a JSP is marked as static, it is not
refreshed when that page is redisplayed e.g. as a result of an event such as a
button click or field immediate validation. JSPs are
always refreshed when moving to a different page. The static setting for a JSP can be configured at template level in the
Form Default Properties or at
form level in the Form Properties, or using
the properties an Include Control.