Skip to Content
0

SAPUI5 MVC in MII 15.1

Sep 20, 2017 at 02:46 PM

103

avatar image
Former Member

I am trying to follow the OpenUI5 Walkthrough in MII 15.1, but I keep running into problems. The first problem is that Step 2 (Bootstrap) did not work. I used the default bootstrap in MIII source (/XMII/JavaScript/bootstrap.js) instead and I could pass this step. The next problem was in Step 4 (Views). I get the error

Uncaught Error: resource sap/ui/demo/wt/view/App.view.xml could not be loaded from /sapui5/resources/sap/ui/demo/wt/view/App.view.xml. Check for 'file not found' or parse errors.

I have the files from the example, but the problem appears to be where the system is looking for the View. It is looking in /sapui5/resources/... and not in the current directory. Here is the index page:

<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta charset="utf-8">
		<title>Walkthrough</title>
		<SCRIPT type="text/javascript" 
			src="/XMII/JavaScript/bootstrap.js" 
			data-sap-ui-theme="sap_belize"
			data-sap-ui-libs="sap.m"
			data-sap-ui-compatVersion="edge"
			data-sap-ui-preload="async"
			data-libs="i5Chart,i5Grid,i5SPCChart,i5Command" 
			data-sap-ui-resourceroots='{
				"sap.ui.demo.wt": "./"
			}' >
		</SCRIPT>
		<script>
			sap.ui.getCore().attachInit(function () {
				sap.ui.xmlview({
					viewName : "sap.ui.demo.wt.view.App"
				}).placeAt("content");
			});
		</script>
	</head>
	<body class="sapUiBody" id="content">
	</body>
</html>

and here is the view:

<mvc:View xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc">
   <Text text="Hello World"/>
</mvc:View>

I am trying to get sapui5 to find the View in the correct folder, however I have not had any luck. Any help would be appreciated. Thank you.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
christian libich Sep 20, 2017 at 04:57 PM
1

You can try "/sapui5/resources/sap-ui-core.js" for your ui5 script src. I think the MII bootstrap created it's own script tag to load the ui5 libs and maybe that is hosing your resource roots definition.

Regards,
Christian

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks, that worked

0