on 03-24-2015 2:02 PM
i want to know any method to refresh pages for mobile or instead of using app.to we can load a view seperately.... right now what happens my page is loading too slow because i am calling these views like this:
Application.js :
main : function() {
sap.ui.localResources("app.view");
var root = this.getRoot();
App = new sap.m.App("MOBILE",{initialPage:"login"});
var loginPage = sap.ui.view({id:"login", viewName:"app.view.login", type:sap.ui.core.mvc.ViewType.JS});
var setContext = sap.ui.view({id:"setContext", viewName:"app.view.setContext", type:sap.ui.core.mvc.ViewType.JS});
var screens = sap.ui.view({id:"screenSelection", viewName:"app.view.screenSelection", type:sap.ui.core.mvc.ViewType.JS});
var standardTransactions = sap.ui.view({id:"transactions", viewName:"app.view.standardTransactions", type:sap.ui.core.mvc.ViewType.JS});
App.addPage(loginPage).addPage(setContext).addPage(screens).addPage(standardTransactions);
App.placeAt(root);
}
index.html:
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="app/css/MobileStyles.css">
<title>Mobile</title>
<!-- src Location of SAP UI5 libraries need to be changed to refer to right location -->
<script
src="/sap/ui5/1/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
type="text/javascript"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-libs="sap.m">
</script>
<script>
jQuery.sap.registerModulePath('Application', 'Application');
// launch application
jQuery.sap.require("Application");
new Application({
root : "content"
});
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
If i have to load any view i have to use app.to() and this method only navigate to the page already loaded first time. If i want to refresh or reload any view what i should do and how to reduce my long loading time.Please tell me any alternative to this ASAP.
I got it how to navigate between pages and load them at any event. The best way is to define sap.m.App it act as a container to load sap.m.Page so u can create as many pages u want and add to the sap.m.App using addPage('<pagename>'). and using app.to() you can navigate to the pages with its IDs. You have to place this sap.m.App at the index.html using placeAt(). and load other views as required. One important thing make the app variable as global to access in all pages.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.