padibro
padibro

Reputation: 1374

How can I include html page into page content?

My target is include a documentation page into a sap.m.Page. I have a sap.m.Page into XML view:

<Page id="idPageSidebar" title="" showNavButton="false" navButtonPress="doBack">
        <content>
           //here I want visualize myDocumentation.html page    
        </content>
    </Page>

I have myDocumentation.html into a directory of my project. How I can include it into a sap.m.Page ?

Upvotes: 2

Views: 3969

Answers (1)

Bogdan
Bogdan

Reputation: 224

use the core:HTML control and add the content via AJAX here an example: http://jsfiddle.net/C4FW7/

      <App>
     <Page title="SAPUI5 App">
         <core:HTML id="html" content="hello"/>
     </Page>
  </App>


sap.ui.controller("my.own.controller", {
    onInit: function(){
         var that=this;
         $.get( "/8rmAU/show/light", function( data ) {
            that.getView().byId('html').setContent(data);
        });
    }
}); 

Upvotes: 5

Related Questions