cancel
Showing results for 
Search instead for 
Did you mean: 

Fragment Resource could not be Loaded. Check for 'file not found'

former_member679019
Participant
0 Kudos

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>

Accepted Solutions (0)

Answers (3)

Answers (3)

maheshpalavalli
Active Contributor

Hi eldwin_cheung24

you need to put the fragments folder inside the webapp folder.

-Mahesh

saurabh_v
Active Participant
0 Kudos

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.

rajveer_1989
Explorer
0 Kudos

Hello eldwin_cheung24,

Did you find the solution for this because i also face the same issue.

BR

Rajveer Rawat