cancel
Showing results for 
Search instead for 
Did you mean: 

style is not working in SAP MII 14.0 SP4

Former Member
0 Kudos

Hi All,

I am trying to use "style" as per below. When I try to load the page I am loading the image and when chart appears I am disabling that.

But whereever the style is used I am not getting the result.

I have tried by putting it in css too. but no result.

<!DOCTYPE HTML>

<HTML>

<HEAD>

  <TITLE>Ingots - BM Crushed Report</TITLE>

  <META http-equiv="X-UA-Compatible" content="IE=edge">

  <META http-equiv='cache-control' content='no-cache'>

  <META http-equiv='expires' content='0'>

  <META http-equiv='pragma' content='no-cache'>

  <link href="https://answers.sap.com/XMII/CM/MTS/Stylesheets/FitToPage.CSS" type="text/css" rel="stylesheet">

  <SCRIPT language="JavaScript">

  function loadapp()

  {

  var SD = document.getElementById("StartDateId").value;

  var ED = document.getElementById("EndDateId").value;

  var app = document.APP_IngotBMCrushed;

  var chartapp = app.getQueryObject();

  document.getElementById("AppLoading").style.display ="inline";

  document.getElementById("ChartApp").style.display ="none";

  chartapp.setStartDate(SD);

  chartapp.setEndDate(ED);

  app.updateChart(true);

  document.getElementById("AppLoading").style.display ="none";

  document.getElementById("ChartApp").style.display ="inline";

  }

  </SCRIPT>

</HEAD>

<FORM>

<BODY onload="loadapp();">

  <TABLE width="100%" height="100%">

  <TR>

  <TD align="center" id="AppLoading" style="display:none" colspan="4"><img src="/XMII/CM/MTS/Images/loading.gif" width="100px" height="100px" ></TD>

  </TR>

  <TR>

  <TD id="ChartApp"  style="display:none">

  <APPLET NAME="APP_IngotBMCrushed"   CODEBASE="/XMII/Classes" CODE="iChart" ARCHIVE="illum8.zip"  WIDTH="100%" HEIGHT="100%"  TABINDEX=1 MAYSCRIPT>

  <PARAM NAME="QueryTemplate" VALUE="MTS/QT/IngotsAndBMCrushedReportSQLQuery"/>

  <PARAM NAME="DisplayTemplate" VALUE="MTS/DT/IngotsAndBMCrushedReportChart"/>

  </APPLET>

  </TD>

  </TR>

  </TABLE>

</BODY>

</FORM>

<input type="hidden" id="StartDateId" value="{StartDate}">

<input type="hidden" id="EndDateId" value="{EndDate}">

</HTML>

But when I use style its throwing error in java console as below

Exception in thread "AWT-EventQueue-14" java.lang.IllegalArgumentException: Width (-4) and height (-41) cannot be <= 0

  at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)

  at java.awt.image.BufferedImage.<init>(Unknown Source)

  at com.sap.xmii.common.ui.GUIUtilities.createImage(GUIUtilities.java:107)

  at com.sap.xmii.common.ui.GUIUtilities.createImage(GUIUtilities.java:94)

  at com.sap.xmii.applet.chart.ChartComponent.layoutComponents(ChartComponent.java:546)

  at com.sap.xmii.applet.chart.ChartComponent.redraw(ChartComponent.java:4585)

  at com.sap.xmii.applet.chart.ChartApplet$1.run(ChartApplet.java:187)

  at java.awt.event.InvocationEvent.dispatch(Unknown Source)

  at java.awt.EventQueue.dispatchEvent(Unknown Source)

  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

  at java.awt.EventDispatchThread.run(Unknown Source)

I have upgraded the jre too but same error.

Please let me know the solution.

Regards

R.Prakash

Accepted Solutions (1)

Accepted Solutions (1)

former_member185280
Active Contributor
0 Kudos

I think the applets height and width must be at least at least 1 pixel. Because you set the initial display state of the table cell to none it has no height and width. Your applet height and width are set to be a percentage of the cell. 100% of zero (or possibly null) is <=0 so you are getting the exception. Try setting the applets height and width to some pixel value like 1000px and 300px and see what happens.

Former Member
0 Kudos

Hi Christian,

I have changed it to px. But now I am getting the following error.

java.lang.NullPointerException

at com.sun.deploy.security.CPCallbackHandler.isAuthenticated(Unknown Source)

at com.sun.deploy.security.CPCallbackHandler.access$1300(Unknown Source)

at com.sun.deploy.security.CPCallbackHandler$ChildElement.checkResource(Unknown Source)

at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source)

at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source)

at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)

at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at com.sap.xmii.applet.common.BaseApplet.stop(BaseApplet.java:1408)

at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Also my loading image is not appearing?

Regards

R.Prakash

former_member185280
Active Contributor
0 Kudos

Oops.. Its been so long since I have worked with the applets that I forgot when you set the height and width you don't need to specify pixels. Like 1000 and 300 instead of 1000px and 300px. I don't know if thats causing your new issue but give it a try.

Former Member
0 Kudos

Hi ,

No the error comes even after changing this. My concern is that why the loading image is not shown?

Regards

R.Prakash

former_member185280
Active Contributor
0 Kudos

Are you getting any javascript exceptions before the line showing the image is executed? Try triggering your load app function with the applets Creation event instead of the body onload event :


<PARAM NAME="CreationEvent" VALUE="loadapp">

Former Member
0 Kudos

Hi,

Thanks man... its working fine in creation event.

But I don't know why its not from onload?

Any way I will use this event.

Regards

R.Prakash

former_member185280
Active Contributor
0 Kudos

Applets are not part of the document so their state does not influence when the onload event is fired by the browser.

xMII Best Practices Guide

Former Member
0 Kudos

Thanks a lot...

Regards

R.Prakash

swaroop_anasane
Active Contributor
0 Kudos

Hi prakash,

Basically applets are not part of html page but it sits on top of the page but asa seperate entity. For instance if you set z:index for table in html as 100 and for applet as -10 still applet would sit on top of table while it over laps. Hope this helps understanding the nature.

Thanks,

Swaroop

Answers (0)