Using the client pull (AJAX) method
For HATS Web applications, you can configure the client pull (AJAX) implementation method, which includes the auto-disconnect and auto-refresh functions.
The auto-disconnect function provides the ability to detect when the browser has been out of contact with your HATS application for a predefined period of time. When detected, disconnect processing is performed to clean up resources associated with the browser session and thereby reduce the load on the server. To do this, the disconnect event is run, and the disconnect macro (if configured) is run.
The purpose of the auto-refresh function is to automatically refresh the Web page view of your HATS application if the underlying host screen changes because the host sent a new screen. This eliminates the requirement for the user to click the Refresh button to see asynchronously changed screens from the host.
- The user has updated the Web page view but not submitted the change.
- Auto-refresh has been disabled for the specific screen. Auto-refresh
may be disabled for a specific screen by adding the following lines
just after the </HATS:Form> tag in the screen
transformation file.
<script> disableBrowserRefresh(formID); </script>
Unlike the server push (applet) implementation method, the client pull (AJAX) method does not require the use of certain browsers, but instead supports all browsers supported by HATS. Also unlike the server push (applet) method, an additional connection to the server is not required, thus simplifying configuration for the HATS Administrator. The client pull (AJAX) method is mutually exclusive of the server push (applet) method. If either of the client pull (AJAX) functions are enabled, then the server push (applet) configuration is ignored.
- The client pull (AJAX) method, including the auto-disconnect and auto-refresh functions, is supported only for HATS Web, including JSR 286 portlet, screen transformation applications.
- This method is not supported in conjunction with the following
HATS functions:
- JSR 168 portlet projects
- WebFacing projects
- Linked HATS/WebFacing projects
- Integration Objects
- EJB projects
- Web services
- Rich client projects
- HATS Web applications optimized for mobile devices do not provide keyboard host key support. As a result, auto-refresh support overwrites any data that the user has entered into the GUI view of the HATS application if a new host screen is asynchronously received from the host application.
- AJAX polling from a browser running on an iPhone or iPod touch device stops when you switch from the browser to another application. As a result, when you switch from a browser accessing HATS to another application on the device, HATS disconnects the browser session after the Time to wait for disconnect (seconds) interval has passed. You may wish to increase this interval or disable the auto-disconnect function for HATS applications accessed from iPhone or iPod touch devices. For more information, see Client pull (AJAX) settings.