cancel
Showing results for 
Search instead for 
Did you mean: 

problem in displaying applet by using dynamic graphics

Former Member
0 Kudos

Hi,

I followed one document for using dynamic graphics editor, the url is

/people/abesh.bhattacharjee/blog/2007/02/27/get-started-with-dynamic-graphics-in-xmii-115 by Abesh Bhattacharjee.

The steps are as follows:

1). Create the tag query

2). Preparing the 3DDialGauge Object

3). Creating the BLS Transaction

4). Creating an Xacute Query for the BLS Transaction

5). Creating the HTML Page with help of applet.

In this HTML page we get that image and also 2 buttons.

Finally we have to get the object designed in step 2 above and it has to change dynamically and refresh the image by pressing one buttons and the other button is to stop the refresh.

Now i am getting the image and 2 buttons as output of that HTML page but the problem is the image is getting refreshed continously without getting proper display and i am pressing the buttons it is not stopping the refresh and the warning message i am getting is

document.TransFanSpeed is null or not an object

and the object is not changing according to the dynamic value please can anyone help me in resolving this problem.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

see to that u have give the name of the applet as TransFanSpeed,

regards,

shyam

Former Member
0 Kudos

Hi shyam,

The html file is as follows:

<html>

<head>

<link rel="stylesheet" type="text/css" href="../../../../ServletExec AS/se-xMII/webapps/default/Lighthammer/Stylesheets/lighthammer.css"><br />

<meta http-equiv="Content-Language" content="en-us">

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>New Page 1</title>

<APPLET NAME="TransFanSpeed" WIDTH="300" HEIGHT="300" CODE="iCommand" CODEBASE="../Classes" ARCHIVE="illum8.zip" MAYSCRIPT><br />

<PARAM NAME="QueryTemplate" VALUE="C:/Lighthammer/Illuminator/Templates/Training/SVGexampleXacutequery"><br />

</APPLET><br />

</head>

<body>

<img src="../../Fan1.jpg" name="refresh"><p></p>

<button onclick="javascript:doit()">Do it !!!</button>

<button onclick="javascript:clearit()">Clear Timeout</button>

<script language="javascript">

var Time;

var imagename;

var tmp;

function doit(){

executeQry();

imagename = "Fan1.jpg";

tmp = new Date();

tmp = "?"+tmp.getTime();

document.images["refresh"].src = imagename+tmp;

Time = setTimeout("doit()", 1000);

}

function clearit(){

clearTimeout(Time);

}

function executeQry(){

document.TransFanSpeed.executeCommand();

}

</script>

</body>

</html>

and the iCommand.java is nothing but internal one there i didn't written any code

Message was edited by:

RAJESH PERLA

Former Member
0 Kudos

Hi Shyam,

Now i am able to get the image in final page reason is i had used .gif file instead of .jpeg file

but now what is the problem is it is not dynamically changing and if i click buttons to get the dynamic image it is not changing and giving one warning

java.lang.nullpointerexception

this error due to that object is not responding--java file for applet

Former Member
0 Kudos

function executeQry(){ 

   if(document.TransFanSpeed.executeCommand()){
          // refresh image
  else{
        //error
   } 


}  
jcgood25
Active Contributor
0 Kudos

You should also consider using png files as they are smaller and faster to render than jpg.

Regards,

Jeremy

Former Member
0 Kudos

Also, it is faster and easier (and requires no Java applet on the client) if you simply invoke the BLS transaction directly and stream the image back using the following technique:

Remove the image saver from your transaction, and simply create one output parameter in your transaction of type "String", named "OutputImage". Link the "EncodedImage" output from the rendering action to the Transaction output named "OutputImage".

http://<yourserver>/Lighthammer/Runner?Transaction=YourTransaction&OutputParameter=OutputImage&Conte...

Of course, you can pass any other parameters you need to send to BLS in the URL as well.

This approach is much more reliable, higher performance, and results in faster initial page loads.

Rick

Former Member
0 Kudos

Hi Rick,

It is working fine and it is changing according to the dynamic values thanks a lot

Answers (0)