on 01-20-2016 4:54 AM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.