This HTML file is intended to simplify starting Rexx programs from
JavaScript.
It is used to dynamically create an HTML page with an EMBED tag
to run a Rexx program. The file is
"called" in a WINDOW.OPEN('Plugin_form2Embed.html',...)
statement in the JavaScript program.
Plugin_form2Embed.html builds the page and the EMBED
parameters from JavaScript variables and HTML INPUT and TEXTAREA
tags in the JavaScript program that "called" Plugin_form2Embed.html, i.e. the
OPENER program.
The "standard" EMBED tag parameters are taken from
JavaScript variables of the same name defined in the opener document. Please
note that JavaScript variable names are case sensitive and
the names variables that are to make up the
"standard" parameters must be in all lowers
The user defined parameters are taken from the INPUT and TEXTAREA
tags/screen "controls"
of the <FORM> on the opener document. The names in the
<FORM> tag are also case sensitive .
Two special JavaScript variables control how the page looks that is built by Plugin_form2Embed.html, three special parameter affect how Plugin_form2Embed.html handles values from the <FORM> "fields".
EMBED tag.
OPENER
document. When formObj=NONE no user defined parameter are created.
If formObj is not defined, the first form in the OPENER
document is used, i.e. document.forms[0]. If formObj equals any other value
that value must be a reference to a form on the OPENER document
that contains "fields" (INPUT and TEXTAREA tags)
that are to be made into user defined parameters.
The first example starts the Rexx program dothis.rex with no user defined parameters.
<html>
<body>
</body>
<script>
var type = 'x-warpdoctor/rexx'
var src = 'http://www.warpdoctor.org/dothis.rex'
var width = 400
var height = 600
var name='program1'
var formObj='NONE'
function makeEmbed()
{
win = window.open("plugin_form2embed.html","win1")
}
</script>
</html>
This next example releases a suspended Rexx program passing one parameter zoning as a JSVar variable to the waiting program. The suspended Rexx program is named showZoning.
<html>
<body>
<form>
<input type='hidden' name='zoning' value='R5' >
</form>
</body>
<script>
var type = 'x-warpdoctor/execute'
var width = 400
var height = 600
var formObj='NONE'
var releaseInstance='showZoning'
function makeEmbed()
{
win = window.open("plugin_form2embed.html","win1")
}
</script>
</html>
The Plugin_form2Embed.html file is shown below.
<html>
<script language="JavaScript" src="http://www.warpdoctor.org/plugin_form2embed.js"></script>
<script>
if (opener.title != undefined) document.write("<title>",opener.title,"</title>");
</script>
<body>
<script>
if (opener.before_htmlstring != undefined) document.write(opener.before_htmlstring)
form2embed()
if (opener.after_htmlstring != undefined) document.write(opener.after_htmlstring)
</script>
</body>
</html>
The JavaScript function form2Embed() does the actual creation
of the EMBED and its parameters. It is called by
Plugin_form2Embed.html to create the EMBED.
You can create your own version of Plugin_form2Embed.html
if the before_htmlstring and after_htmlstring "special"
variables do not provide enough flexibility to create your page the way
you want. Just call form2Embed() from somwhere in your HTML page
to create the EMBED