Quantcast
Channel: SCN: Message List - SAP Manufacturing Integration and Intelligence (SAP MII)
Viewing all articles
Browse latest Browse all 4841

Re: SAP UI5 Overlay Container not working from MII

$
0
0

Hi Prashant,

 

I tried the above code, the first script tag refers to /XMII/JavaScript/bootstrap.js which also loads sap-ui-core.js internally. However it doesn't load ux3 library. Followed by that script tag you again have another script tag where you explicitly load ux3 library, however the src attribute's value has to be changed to this: /sapui5/resources/sap-ui-core.js

i.e the UI5 js file should be accessible using the following url:

http|s://<host>:<port>//sapui5/resources/sap-ui-core.js

 

You can modify your code as shown below and try:

 

 

     <!DOCTYPE HTML>

     <html>

     <HEAD>

       <TITLE>Overlay Container Test</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'>

      <!-- <SCRIPT type="text/javascript" src="/XMII/JavaScript/bootstrap.js" data-     libs="i5Chart,i5Grid"></SCRIPT> -->

       <script id="sap-ui-bootstrap" type="text/javascript"

       src="/sapui5/resources/sap-ui-core.js"

       data-sap-ui-theme="sap_goldreflection" 

       data-sap-ui-libs="sap.ui.ux3, sap.ui.commons">

       </script>

     <script type="text/javascript">

 

 

     function handler(oEvent) {

       alert("Event '"+oEvent.getId()+"' triggered");

     }

     

 

     var oOverlayContainer = new sap.ui.ux3.OverlayContainer();

     oOverlayContainer.addContent(new sap.ui.commons.TextView({text: "Some Content ..."}));

     oOverlayContainer.attachClose(handler);

     oOverlayContainer.attachOpen(handler);

     oOverlayContainer.attachOpenNew(handler);

 

 

     var oButton = new sap.ui.commons.Button({

       text: "Open Overlay Container",

       press: function(oEvent){

       if(!oOverlayContainer.isOpen()){

       oOverlayContainer.open();

       }

       }

     });

     oButton.placeAt("sample1");

     </script>

     </HEAD>

     <body class='sapUiBody'>

       <div id='sample1'></div>

     </body>

     </HTML>

 

With the above code I was able to get the overlay container.

Please try and let me know if you still face issues.

 

Regards,

Ria


Viewing all articles
Browse latest Browse all 4841

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>