Introduction
The ZIE for Web-Client provides an additional capability to handle the Host function keys in a customized way. With this feature, Users can handle or provide various actions for the host function keys based on their requirements.
Pre-requisites
The user needs to configure the path of the custom template by following the steps:
- Using the parameter ‘templateURL’ in the web.properties file under ZIE for Web publish/private directory.
- The other way is to configure the custom template path via the admin console of ZIE for Web-Client.
Quick Actions to get benefit out of this feature:
- To begin with, the admin needs to set the parameter ‘isHandleKeyExternaly’ as true in a custom template within a <script></script> or an external script file.
- And to handle the host function keys in a customized way, we make use of the function “handledKeyExternally(keyPressed, data, TEXT_PLANE, sessionName)”
where keyPressed– gives the Host function key (in mnemonics) in the current screen.
data– an array that holds the ‘text, startRow, startCol’ of the current screen
TEXT_PLANE-a two-dimensional array which holds the current screen data for row and column
sessionName– holds the current session name where the key is pressed
- The above-mentioned must have a Boolean return type, either true or false.
- If the function returns false, it will execute the action in the custom script before the return statement and send the key/command to the host.
- If the function returns true, it will execute the action in the custom script mapped for this key, and the key/command will not be sent to the host.
- We also provide an additional API method like Session Manager API to access the green screen contents that would be quite helpful to handle keys externally.
- Some of the methods are:
- function Sync_getString4 (String sessionName, int row, int col, int length)
- function Sync_sendKeys2(String sessionName, String text)
(For more information on the available methods, refer to the HCL Knowledge center -ZIE for Web-Client)
- All these API methods must be enclosed within the handledKeyExternally method in the custom JavaScript file.
- Code snippet:
<script src=”https://<IP_of_ZIEWeb_Server>:<port>/<ZIEWeb_ALIAS>/customscriptfile.js”>
Option 1:
function handledKeyExternally(keyPressed,data,TEXT_PLANE,sessionName){
for(n in data){
textEntered=data[n].text.trim ();
if(keyPressed==”[pf3]”){
if(textEntered===”SAMPLE”){
var url=”https://www.google.com”;
parent.window.open(url,’_blank’);
return true;
}
}
}
}
Option 2:
function handledKeyExternally(keyPressed,data,TEXT_PLANE,sessionName){
if(keyPressed==”[pf3]”){
if(Sync_getString4(“3270 Display-A”,2,1,6)===” SAMPLE “){
var url=”https://www.google.com”;
parent.window.open(url,’_blank’);
return false;
}
}
}
Limitations
The custom script file must be placed in the Z and I Emulator for Web publish directory and provide the path in the custom template.
This feature is only for handling the Host function PF keys and is not applicable for characters or custom function keys.
Start a Conversation with Us
We’re here to help you find the right solutions and support you in achieving your business goals.