Skip to Content
0
May 10, 2018 at 12:54 PM

Using Applet in View/Controller in SAP MII 15.1

339 Views

Hi,

I have a task to upgrade SAP MII 12.1 to SAP MII 15.1. And I got problem with applet + View/Controller need your help.

In old app, I have an applet in .irpt file:

<applet WIDTH="705" NAME="mySPCChart" MAYSCRIPT="true" HEIGHT="250" CODEBASE="/XMII/Classes" CODE="iSPCChart" ARCHIVE="illum8.zip">
    <PARAM NAME="QueryTemplate" VALUE="Operator/RecordsByMatNumForSPCQuery"/>
    <PARAM NAME="DisplayTemplate" VALUE="Operator/RecordsByMatNumSPCChart"/>
    ...
    <PARAM NAME="CreationEvent" VALUE="CreateSpcApplet"/>
    <PARAM NAME="UpperChartSelectionEvent" VALUE="getSelectedApplet"/>
</applet>

<script>
function CreateSpcApplet() {
...
}
function getSelectedApplet() {
...
}
</script>


In new app, I'm using SAPUI5 with View and Controller to handle the page. I don't know how to show the applet and how to handle the CreationEvent and UpperChartSelectionEvent in my controller.

I tried to use JSView to show the applet. But I don't know where to implement/write function CreateSpcApplet/CreationEvent and getSelectedApplet/UpperChartSelectionEvent

sap.ui.jsview("OperatorUI.InspLotCharInputFormItem", { 
  getControllerName : function() {
    return "OperatorUI.InspLotCharInputFormItem";
  },
  createContent : function(oController) {  
    var chartHTML = new sap.ui.core.HTML({
      content: '<applet name="mySPCChart" codebase="/XMII/Classes" code="iSPCChart" archive="illum8.zip" width="705px" height="250px" mayscript="true">' +
      '<param name="QueryTemplate" value="Operator/RecordsByMatNumForSPCQuery"/>' +
      '<PARAM NAME="DisplayTemplate" VALUE="Operator/RecordsByMatNumSPCChart"/>' +
      ...
      '<PARAM NAME="CreationEvent" VALUE="CreateSpcApplet"/>' +
      '<PARAM NAME="UpperChartSelectionEvent" VALUE="getSelectedApplet"/>' +
      '</applet>'
    });
    return new sap.m.Page({
      title: "{/Name}",
      content: [
        chartHTML
      ]
    });
  }
});