on 09-18-2014 6:47 AM
Hi Experts,
I need to pass data from a one view to another by taking data from user in textfield and show it in other view using simple text control.
for navigation i'm using routing
metadata : {
routing : {
config : {
viewType:"XML",
viewPath:"view",
targetControl:"navContainer",
targetAggregation:"pages",
clearTarget : false
},
routes : [
{
pattern : "",
name : "adminHome",
view : "adminHome"
},
{
pattern : "Home",
name : "Home",
view : "Home"
}
]
}
}
Regards,
Rajesh Roy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
Using navTo() you can call another view and pass data to the another. You will have to update your routes as follows:
{
pattern : "Home/{data}",
name : "Home",
view : "Home"
}
you can call another view say "Home" as follows:
this.oRouter.navTo("Home",{
data : "yourData value";
});
and in your Home view controller init() you can get the data as follows:
oView=this.getView();
var dataPassed;
oDataModel = this.oApplicationFacade.getODataModel();
this.oRouter.attachRouteMatched(function(oEvent) {
oViewName = oEvent.getParameter("name");
if (oViewName === "Home") {
dataPassed= oEvent.getParameter("arguments").data;
}
});
Regards,
Rauf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
For Routing, you can refer to
API refrence
JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.core.routing.Router
Regards,
Nikhil
Hi Mate
As u said i have changed the component.js
i tried to bring the context to detail page but still i am not able to see the properties in evt object
Master Page Controller:
sap.ui.core.UIComponent.getRouterFor(this).navTo("porder", { | |||
//from: "main", | |||
product: oItem.getBindingContext('Northwind').getPath().substr(1), | |||
//ctx : bindingContext | |||
//tab: "supplier" | |||
}, false); |
Component.js:
pattern:"porderDetail/{product}", | |||||||
name : "porder", | |||||||
viewPath : "com.viz.view.Detail", | |||||||
view : "Detail", | |||||||
// | viewLevel : 1, | ||||||
targetControl : "splitApp_viz", | |||||||
targetAggregation : "detailPages" | |||||||
} |
i am not able bind any thing in the detail xml view
below i have mentioned the screens...
My Detail view still look empty:
User | Count |
---|---|
70 | |
9 | |
9 | |
7 | |
6 | |
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.