on 02-18-2013 8:46 AM
Hi Guys,
I want to pass a Value from Page1 of my SAPUI5 Mobile App to Page2. But I don't know how can I pass it and then use this value on Page2 (in MVC Architecture). Please guide me in this regard.
Thanks and best regards.
Fahad.
Hi Fahad,
please check the respective documentation at
https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/MVC.1.html
and my answer in the other thread:
http://scn.sap.com/message/13854804#13854804
Regards
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fahad
Take a look at the following example
sapui5-static/test-resources/sap/m/internal/demo/DemoAppToDoList.html
Its a mobile application using MVC. It has 2 pages notes and details.
from notes.controller.js
showDetails : function(record) {
if (!this._detailsView) {
this._detailsView = sap.ui.jsview("todolist.details");
}
this._detailsView.getController().show(record);
When the user drills into a line of noteList the function showDetails in the notes.controller is called.
This then calls the details.controller via the details.view and passes the current record.
A nicer solution is the one Andreas suggested to you earlier in another post, use the EventBus. It is available in the latest version, very easy to use, below is a simple example of using events to pass data. When navigating between pages you can use events, subscribe on one publish on another.
$.sap.require("sap.ui.core.EventBus");
var oBus = sap.ui.getCore().getEventBus();
var params = {param1: "helloWorld"};
show = function(sChannelId, sEventId, oData){
alert(oData.param1);
};
//to subscribe
oBus.subscribe("myChannel","goToDetailsPage", show);
//to publish data between pages
oBus.publish("myChannel","goToDetailsPage",params);
Cheers
John P
Sorry Andreas, when i started my response there were no replies.
For those wanting to see a sap.ui.core.EventBus example http://jsbin.com/ojobiy/2/edit
Message was edited by: John Patterson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
9 | |
9 | |
7 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.