ApplinX HTML Emulation provides a ready to use, fully functional Web emulation. It is part of ApplinX installation and is available in JSP and .NET. It is a thin-client Web application and uses JavaScript and HTML for configuration and fine-tuning.
To install a new HTML emulation refer to the Framework Manager or to the Eclipse Plug-in/Visual Studio documentation. The emulation template is based on the new_application Web application. It is possible to configure various features in the Framework Configuration Editor in the Emulation node. All the emulation features are relevant both for instant and generated pages (that inherit from GXDefaultLogicContext) unless otherwise displayed in the Emulation node in the Framework Configuration Editor. Detailed below are some tasks which require configuring a number of parameters.
Use the user exits in userExit.js.
GXHostScreenChecker.hostScreenSeqCheckBeforeRefresh(isDirty) > returns boolean
This user exit method is used to perform additional queries for this feature. For example to check whether the data on the screen is saved. If it is not saved, return false to stop the browser from refreshing to prevent data loss.)
Example:
/** * userExists.js prompt user if the screen is dirty */ function GXHostScreenChecker.hostScreenSeqCheckBeforeRefresh(isDirty) { //check if (isDirty) { //ask & get answer from user... alert("Host screen was updated. Data entered will be lost"); return false; //stop refreshing } return true; //continue refreshing }
GXHostScreenChecker.hostScreenSeqCheckSetTimer(ticks) > returns times
This user exit method is used to change the times for the checker timer. The user gets the current setting time and can return a different value. For example: the user finds 3, 6, 12, 24 too frequent, so in order to increase the time intervals he can return time*3 which results in 9, 18, 36, 72)
Example:
/** * userExists.js reset the timer */ function GXHostScreenChecker.hostScreenSeqCheckSetTimer(ticks) { return ticks*3; }
It is possible to enable the user to control the font size used in the Web application. Font sizes between 10 and 24px are possible (10, 12, 14...24px).
To enable user control of the font size:
Copy the plus/minus links from the header section in the HTML emulation.
Set these links to call the gx_increaseFontSize()
or the
gx_changeFontSize(<desired size in pixels>)
JavaScript
functions and the gx_decreaseFontSize()
JavaScript function.
Example:
<input type="button" value="+" onclick="gx_increaseFontSize(12);" />
Refer to Configuring your Framework and access the Framework Configuration Editor. In the Instant node, Font size field, select the Dynamic by resolution option from the drop-down list.
As in most terminal emulators, also ApplinX enables printing a snapshot of the current host screen. By executing a JavaScript function a pop-up screen appears enabling users to print the current screen. This window, unlike the Instant screen, does not include any changes (such as transformations) in the screen.
To enable users to print a capture of the host screen:
Add a button/link to the application's Master page
(template.jsp/template.master.cs). You can place it
anywhere you see fit. Set it to call gx_printScreen()
.
<input type="button" id="printButton" onClick="gx_printScreen();" />
Dup and FieldMark are special mainframe characters. In instant and generated pages, a user can send to the host a not printable character in specific input fields.
To enable sending Dup and FieldMark characters to the host:
Refer to Configuring your Framework and access the Framework Configuration Editor. In the Emulation node, select the Support Dup and FieldMark host keys check box.
In the Keyboard mapping node, map two keys, for example:
Host action key: [dup]; Press a keyboard combination: CTRL+D
Host action key: [fieldmark]; Press a keyboard combination: CTRL+F
You can also perform this mapping using JavaScript:
function pageOnLoad(){ gx_engine.addKeyBoardMapping( GXAdditionalKey.CTRL, 68 /* Character 'd' Ascii code */ , gx_dup(), true); }
When pressing CTRL+D (dup) the field will be marked with an asterisk ("*") and the cursor will move to the next field.
When pressing CTRL+F (fieldMark) the field will be marked with a semi colon (";").