cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Ui5 in Personas

former_member192584
Participant
0 Kudos

Hi guys,

          I am new to sap personas 3.0. I have a problem in scripting. I created a simple button using sap ui5 libraries and displayed it in the html viewer but no content is displaying, when i seperately run the code in browser it works fine when i include it in personas its not working. I dont know whats the problem kindly guide me through it.

Note:

    I have downloaded the SAP UI5 libraries to my working machine

    I have given the scripting and screen shot of error

var html = "<!DOCTYPE html>  \

<html><head>  \

    <meta http-equiv='X-UA-Compatible' content='IE=edge' />  \

    <title>Hello World</title>\

                <script id='sap-ui-bootstrap'\

        src='file:///C:/Users/vr00432119/Desktop/openui5-runtime-1.32.9/resources/sap-ui-core.js'  \

        data-sap-ui-theme='sap_bluecrystal'  \

        data-sap-ui-libs='sap.m'></script>  \

<script>  \

var btn = new sap.m.Button({text:'vicky'});\

btn.placeAt('content');\

</script>\

</head>\

<body id='content' class='sapUiBody'>\

</body>\

</html>";

session.findById("wnd[0]/usr/htmlViewerPersonas_1453117031539").content = html;


Error message in browser console:

     Uncaught ReferenceError: sap is not defined

thanks in advance

regards

Vigneshkkar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Did you read through this blog about ? It shouldn't require much modification to create a button.

Having the button do something is another matter - making event handlers for UI5 controls isn't straightforward.

Steve.

former_member192584
Participant
0 Kudos

Yes steve I referred your blog, yet i could not get the output,I am working personas on the remote machine do i have to install the UI5 library files on the server to make it work in personas script because the same UI5 script given inside the html variable works separately in the browser.

Regards,

Vignesh

Former Member
0 Kudos

Are there any helpful messages in the browser error log? It might be that loading the main page from the server and the UI5 libraries from a local file is triggering some XSS protection. I would certainly load the UI5 libraries from the server - they will be there for sure as the Personas client uses them!

Steve.

former_member192584
Participant
0 Kudos

This is the only error i get in browser Steve. Personas script does not throw any error.

I have loaded the UI5 libraries from my local machine as you can see below.

<script id='sap-ui-bootstrap'\

        src='file:///C:/Users/vr00432119/Desktop/openui5-runtime-1.32.9/resources/sap-ui-core.js'  \

        data-sap-ui-theme='sap_bluecrystal'  \

        data-sap-ui-libs='sap.m'>

Vignesh

Former Member
0 Kudos

Try loading the libraries from the backend server...

former_member192584
Participant
0 Kudos

Thanks Steve it works now

Answers (0)