cancel
Showing results for 
Search instead for 
Did you mean: 

Applet selection event cannot resize another applet properly

Former Member
0 Kudos

Hi Experts,

I found something weird about using one applet's selection event to resize another applet. I have a ispcchart and a igrid. What I want to do is expand the chart when I select the igrid. Using the selection event, the chart frame did expand but the chart area remains the same size(selection event of ibrowser has the same problem). But when I use a button onclick to call the same function, the chart and the chart area expand proportionally as expected. Is this a bug or a Java behaviour? Is there a workaround that I can make the applet selection + resize working? Attached the sample code below. BTW, I also tried to use selection event to call some javascript to create a applet in a td. It hung the webpage while a button onclick works properly.

My MII version is 12.2.3(179). Thanks in advanced.

Best regards,
Lawrence

<HTML>
<HEAD>
<TITLE>Your Title Here</TITLE>

<SCRIPT language="JavaScript">

function btnClickClick(){     // same code as grdSelected()
document.getElementById("Data").width=600;
document.getElementById("Data").height=300;
document.getElementById("Data").setDisplayTemplate("Lawrence/DisplayTemplates/spcData");
document.getElementById("Data").updateChart(true);
}

function grdSelected(){     // same code as btnClickClick()
document.getElementById("Data").width=600;
document.getElementById("Data").height=300;
document.getElementById("Data").setDisplayTemplate("Lawrence/DisplayTemplates/spcData");
document.getElementById("Data").updateChart(true);
}

</SCRIPT>
</HEAD>
<BODY>
<table height="700" width="800">
<tr  height="30%">
<td id="td1" width="50%">abjcklajskdfljaskl;dfj</td>
<td id="td2" width="50%">

      <applet width="300" height="150" id="Data" name="Data" codebase="/XMII/Classes" code="iSPCChart" archive="illum8.zip" width="100%" height="100%" mayscript>
        <param name="QueryTemplate" value="Lawrence/QueryTemplates/xacData">
        <param name="DisplayTemplate" value="Lawrence/DisplayTemplates/spcData">
        <param name="InitialUpdate" value="true">
      </applet>

</td>
</tr>
<tr height="30%">
<td><input type="button" id="btnClick" value="click" onclick="btnClickClick()"></td><td></td>
</tr>
<tr height="30%">
<td>
      <applet name="Data" codebase="/XMII/Classes" code="iGrid" archive="illum8.zip" width="400%" height="200%" mayscript>
        <param name="QueryTemplate" value="Lawrence/QueryTemplates/xacData">
        <param name="DisplayTemplate" value="Lawrence/DisplayTemplates/grdData">
        <param name="InitialUpdate" value="true">
<param name="SelectionEvent" value="grdSelected">
      </applet

</td><td></td>
</tr>

</BODY>
</HTML>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Shot in the dark but I would try using the javascript setTimeout() function.

Former Member
0 Kudos

Thanks for the suggestion. But I've tried both setTimeout and alert. Looks like it's not a timing issue.

Former Member
0 Kudos

Maybe try triggering the the button click event in the grid selected event function, something like document.getElementById("btnClick").click();

Former Member
0 Kudos

Tried that too. Still no luck...