Another solution is to give the ip and port address in the HTML file loading the TN3270 applet.
<HTML> <HEAD> <TITLE> Mocha TN3270 example </TITLE> </HEAD> <BODY> <APPLET CODE="tn3270.class" ARCHIVE="tn3270.jar" WIDTH="800" HEIGHT="500" scriptable="true"> <param name="host" value="myibmmainframeip"> <param name="port" value="23"> <param name="ssl" value="false" <param name="tn3270e" value="true"> <param name="luname" value=""> <param name="keylayout" value=""> <param name="32x80" value="true"> <param name="ebcdic" value="37"> <param name="autoconnect" value="false"> <param name="user" value=""> <param name="password" value=""> <param name="license" value=""> <param name="license_key" value=""> <param name="hotspots" value="true"> <param name="font" value="Courier New"> <param name="fontstyle" value="Plain"> <param name="margin" value="36"> <param name="tool_bar" value="true"> <param name="menu_bar" value="true"> <param name="show_fxx" value="true"> <param name="negotiate" value="false"> <param name="debug" value="false"> <param name="color_bg" value="#000000"> <param name="color_cursor" value="#FFFFFF"> <param name="color_select" value="#808080"> <param name="color_red" value="#FF0000"> <param name="color_blue" value="#5E98FE"> <param name="color_pink" value="#FF00FF"> <param name="color_green" value="#00FF00"> <param name="color_turquoise" value="#00FFFF"> <param name="color_yellow" value="#FFFF00"> <param name="color_white" value="#FFFFFF"> <param name="keylayout" value="default"> <param name="keepalive" value="false"> <param name="show-f1-f12" value="true"> <param name="show-f13-f24" value="false"> <param name="show-extra" value="true"> <param name="2xclick" value="false"> <param name="nodialog" value="false"> <param name="numeric" value="true"> <param name="beep" value="true"> <param name="hideviewmenu" value="false"> <param name="hideoptionmenu" value="false"> <param name="smallconnectdialog" value="false"> </applet> </body> </html>CODE parameter must always be "TN3270.class". It is the name of the master file for the binary Mocha TN3270 product. To use the full width use "100%"
Each parameter
is build of a name and a value. In the example above parameter host is
given value unix.
It is very important to remember <> around each line, and the value must
be surrounded with "".
As to give keyboard focus to the applet when loaded add a small script:
<script type="text/javascript"> onload = function() { document.getElementsByTagName( "APPLET" )[0].focus(); } </script>
Syntax:
name=keylayout value="<a file name>"
Syntax:
name=license value="<name of a company>"
Syntax:
name=license_key value="<encrypted key>"
Syntax:
name=user value=<userid>
name=password value=<password>
Example:
name=user value="joe"
name=password value="password"
Syntax:
name=ebcdic value="codepage number"
Example:
name=ebcdic value="277"
Syntax:
name=nodialog value="true | false"
Default is false.
Syntax:
name=numeric value="true | false"
Default is true.
Syntax:
name=tn3270e value="true | false"
Default is true.
Syntax:
name=tn3270e value="a luname"
Syntax:
name=beep value="true | false"
Default is true.
Syntax:
name=hideviewmenu value="true | false"
Default is false.
Syntax:
name=hideoptionmenu value="true | false"
Default is false.
If the connect dialog should only have ip, port and ssl/tls option displayed
Syntax:
name=smallconnectdialog value="true | false"
Default is false.
Syntax:
name=tool_bar value="true | false"
Default is true.
Syntax:
name=menu_bar value="true | false"
Default is true.
Syntax:
name=show_fxx value="true | false"
Default is true.
Syntax:
name=color_bg value="#rrggbb"
where
The syntax is the same as used in the HTML language.
Example:
name=color_bg value="#20f030"
Syntax:
name=color_red value="#rrggbb"
name=color_blue value="#rrggbb"
name=color_pink value="#rrggbb"
name=color_green value="#rrggbb"
name=color_turquoise value="#rrggbb"
name=color_yellow value="#rrggbb"
name=color_white value="#rrggbb"
where
The syntax is the same as used in the HTML language.
Syntax:
name=color_select value="#rrggbb"
where
The syntax is the same as used in the HTML language.
Syntax:
name=color_cursor value="#rrggbb"
where
The syntax is the same as used in the HTML language.
Syntax:
name=host value=<a host name>
name=port value=<number>
The host name can either be a name or an internet
address as 198.66.23.11. There is not a real server at this address!
Syntax:
name=SSL value="true | false"
Default is false
Syntax:
name=autoconnect value="true | false"
Default is false
Syntax:
name=32x80 value="true | false"
Default is false
Syntax:
name=font value="font name"
name=fontstyle value="style"
Default is Courier. To see the font names possible to use, start mocha TN3270 in a browser, and select menu - settings - font.
Possible font styles are :Plain,Bold, Italic and Bold Italic.
Syntax:
name=keepalive value="true | false"
Default is true
Syntax:
name=margin value="36"
Default is 36
The package includes an example keyboard file keys32, which can be used with parameter "keylayout".
Syntax for file "keys32.txt":
The pc-key's are:
fxx | : xx is 1 .. 24 (function key f1 - f12) |
Fxx | : xx is 1 .. 24 (shift + function key f1 - f12) |
cfxx | : xx is 1 .. 24 (ctrl + function key f1 - f12) |
CFxx | : xx is 1 .. 24 (shift + ctrl + function key f1 - f12) |
HOME | |
END | |
PGUP | |
PGDN | |
ESC | |
RETURN | |
SCROLL | |
PAUSE | |
INSERT | |
CTRL | |
KEYPADENTER |
The 3270 keys are:
pf1 - pf24 | |
pa1-pa4 | |
insert | |
erase | (erase all input fields) |
attn | |
systreq | |
dup | |
fm | |
begin | (goto the start of the current field) |
end | (goto end of the current field) |
clear | (send clear request to the host) |
reset | (reset keyboard) |
enter | |
previous | jump to the previous field |
next | jump to the next field |
Example of a "keys" file:
# TN3270 keymap # f1 = f1 key , F1 = shift F1 # cf1 = f1 + ctrl CF1 = shift f1 + ctrl # # <pc - key> <3270 key> f1 pf1 f2 pf2 f3 pf3 f4 pf4 f5 pf5 ..
pc-Key 3270-key pc-key 3270-key ----------------------- ----------------------------- f1 PF1 crtl f1 pa1 f2 PF2 ctrl f2 pa2 f3 PF3 ctrl f3 pa3 f4 PF4 ctrl f4 ATTN f5 PF5 ctrl f5 SYSREQ f6 PF6 ctrl f6 INSERT f7 PF7 ctrl f7 ERASE INPUT f8 PF8 ctrl f8 DUP f9 PF9 ctrl f9 FM f10 PF10 ctrl f10 - f11 PF11 ctrl f11 - f12 PF12 ctrl f12 - pc-Key 3270-key pc-key 3270-key ----------------------- ----------------------------- shift f1 PF13 crtl shift f1 CLEAR shift f2 PF14 ctrl shift f2 RESET shift f3 PF15 ctrl shift f3 BEGIN shift f4 PF16 ctrl shift f4 END shift f5 PF17 ctrl shift f5 - shift f6 PF18 ctrl shift f6 - shift f7 PF19 ctrl shift f7 - shift f8 PF20 ctrl shift f8 - shift f9 PF21 ctrl shift f9 - shift f10 PF22 ctrl shift f10 - shift f11 PF23 ctrl shift f11 - shift f12 PF24 ctrl shift f12 -
pc-Key 3270-key ------------------------ HOME BEGIN END END PGUP PREVIOUS PGDN NEXT ESC RESET KEYBOARD RETURN ENTER CTRL RESET KEYPAD ENTER ENTER
If parameter "license_key" is not given, the program will run in Demo mode, and a session is restricted to 180 seconds