on 07-23-2019 4:54 AM
Hi experts.
I am trying to use xml template in fragment but it does not work and i am getting error below.
Uncaught Error: failed to load 'http://schemas/sap/com/sapui5/extension/sap/ui/core/template/1/repeat.js' from ../../resources/http://schemas/sap/com/sapui5/extension/sap/ui/core/template/1/repeat.js: 404 -
In fragment i use namespace
xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
How to resolve this issue ?
you use the template as view directly? you have to process the template view before it can be used as target.
Restriction
XML templating is not directly supported with routing, that is, there is no way to declare that the XML Preprocessor should run on the target view of a route. Instead, you should define a JavaScript view as the route's target and use that view'screateContentmethod to create an XML view with templating. In case you need access to models (which are not yet available in that hook), you should return some dummy content first (for instance sap.m.HBox), register to the view's modelContextChange event and create the inner view in that event's handler, finally adding it to the dummy content.
JavaScript Target View For Routing
sap.ui.jsview("some.package.RouteTargetView",{
createContent :function(){return sap.ui.view({
async :true,
preprocessors :{
xml :{// ...}},
type : sap.ui.core.mvc.ViewType.XML,
viewName :"some.package.TemplateView"});}});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
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.