on 06-12-2017 8:36 PM
I know I can call other JS files from XSJS by making a .xsjslib file. I would like to be able to call a JSView instead. Is this possible?
Note: the reason for me to this is that I can then use the sapui5 libraries and make it easier to import external libraries to my code.
I'm afraid it doesn't work like that. XSJS executes on the server side and SAPUI5 executes on the client side. A small block of code you might isolate and rewrite as XSJSLIB, but that's the only way to reuse JavaScript in XSJS in XSC. If you really want to use external modules in XSJS, I suggest migrating to XS Advanced. There the XS runtime is based upon Node.js and you can call external node modules with the $.require API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Of course the Reference API for XSJS is available in the online help documentation: https://help.sap.com/http.svc/rc/3de842783af24336b6305a3c0223a369/2.0.01/en-US/index.html
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.