on 05-19-2020 5:29 PM
I'm trying to code a fragment in my View2, yet system can't find the file. This is what I did:
View 2 code:
<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="e24.controller.View2"
xmlns:html="http://www.w3.org/1999/xhtml" xmlns:t="sap.ui.table">
<Page title="View 2">
<content>
<core:Fragment fragmentName="e24.fragments.tableData" type="XML"></core:Fragment>
</content>
</Page>
</mvc:View>
Directory:
Namespace (defined in below Component.js code):
sap.ui.define(
["sap/ui/core/UIComponent"],
function(UIComponent){
return UIComponent.extend("e24.Component",{
metadata: { manifest:"json" },
init: function(){
UIComponent.prototype.init.apply(this);
var oRouter= this.getRouter();
oRouter.initialize();
}
});
});
Full Error Message:
As an added note, here is my fragment code if(?) that might be useful:
<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns="sap.m" xmlns:t="sap.ui.table">
<Button text="hi"></Button>
</core:FragmentDefinition>
Hi eldwin_cheung24
you need to put the fragments folder inside the webapp folder.
-Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What maheshkumar.palavalli has mentioned is absolutely right. The namespace "e24" defined in your project is the one for all the content within the webapp folder. As your fragments folder is outside the webapp folder, you are getting the error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello eldwin_cheung24,
Did you find the solution for this because i also face the same issue.
BR
Rajveer Rawat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.