I'm new at sapui5 mvc i searched everywhere but nothing seem to work for me. I have a simple view and controller and just need a help to start with this. I have to do this with separated files. Here is my code
LinkGroup.view.xml
<mvc:View
controllerName="sap.m.sample.Link.LinkGroup"
xmlns:l="sap.ui.layout"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<l:VerticalLayout
class="marginVerticalContent"
width="100%">
<l:content>
<Link
text="Click me"
press="handleLinkPress" />
<Link
text="Disabled link"
enabled="false" />
<Link
text="Open SAP Homepage"
target="_blank"
href="http://www.sap.com" />
</l:content>
</l:VerticalLayout>
</mvc:View>
LinkGroup.controller.js
sap.ui.controller("sap.m.sample.Link.LinkGroup", {
handleLinkPress: function (evt) {
jQuery.sap.require("sap.m.MessageBox");
sap.m.MessageBox.alert("Link was clicked!");
}
});
index.aspx
<head>
<script type="text/javascript">
sap.ui.controller("LinkGroup", { });
var oView = sap.ui.xmlview({
viewContent: jQuery('#LinkGroup').html()
});
oView.setModel(new sap.ui.model.json.JSONModel({ }));
oView.placeAt('content');
</script>
</head>
<body class="sapUiBody">
<form id="form1" runat="server">
<div id="content">
</div>
</form>
</body>
This throws the "Neither view name/content nor an XML node is given" error. Every help appreciated
sap.ui.controller("LinkGroup", { });in your index.aspx is playing havoc, as you already defined a controllersap.m.sample.Link.LinkGroup- Qualiture