This sample provides information on how to create and use multiple instances of Ephox EditLive! for Java within a Web page. It also provides an example processing page which demonstrates how to retrieve information from each instance of EditLive! for Java within in the Web page.
Please note: This sample will not function on client machines running the Apple Macintosh operating system, MacOS X below version 10.2.
The following skills are required prior to working with this sample:
Ensure you have set up your Web server as described in Installing the EditLive! for Java SDK.
A page Web page with two instances of EditLive! for Java within it is initially loaded. Content within both these instances of EditLive! for Java can be edited. This content can then be processed and viewed by pressing the Display Content button on the bottom of the Web page.
This sample demonstrates how to perform the following with EditLive! for Java and JavaScript:
This article assumes you have an understanding of the basics of integrating EditLive! for Java into a page. If you would like to learn more about this before reading this article please go to EditLive! for Java Integration Basics.
The procedure to create multiple instances of EditLive! for Java within a Web page is essentially the same as creating single instances of EditLive! for Java. There are, however, some things which should be noted.
In order to create multiple instances of EditLive! for Java within a Web page the procedure is essentially the same as creating single instances of EditLive! for Java within a Web page. There are, however, some things which should be noted.
<!--Include the EditLive! for Java JavaScript Library-->
<script src="redistributables/editlivejava/editlivejava.js"></script>
<script language="JavaScript">
//Create the EditLive! for Java object
var editlivejava1;
editlivejava1 = new EditLiveJava("ELJApplet1",
"600", "400");
//Set the location for the XMLURL
editlivejava1.setXMLURL("redistributables/editlivejava/sample_eljconfig.xml");
//Set the initial contents of EditLive! for Java
editlivejava1.setBody("<p>Document contents
for EditLive! for Java</p>");
//Set the source file location directory
editlivejava1.setDownloadDirectory("redistributables/editlivejava");
//Set the JRE download location
editlivejava1.setLocalDeployment(false);
//Display the applet
editlivejava1.show();
</script>
<script language="JavaScript">
//Create the EditLive! for Java object
var editlivejava2;
editlivejava2 = new EditLiveJava("ELJApplet2",
"600", "400");
//Set the location for the XMLURL
editlivejava2.setXMLURL("redistributables/editlivejava/sample_eljconfig.xml");
//Set the initial contents of EditLive! for Java
editlivejava2.setBody(escape("<p>Document contents
for EditLive! for Java</p>"));
//Set the source file location directory
editlivejava2.setDownloadDirectory("redistributables/editlivejava");
//Set the JRE download location
editlivejava2.setLocalDeployment(false);
//Display the applet
editlivejava2.show();
</script>
Multiple instances of EditLive! for Java can be quickly and easily created within the one Web page, as can be seen in this example.
Copyright © 2001-2004 Ephox Corporation. All Rights Reserved.