cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer several attributes to next page in UI5

former_member621809
Discoverer
0 Kudos

Hi all,

I like to transfer several attributes (IDs) to my next UI5 page/view.

Ususally the code will look like this if you transfer one ID:

this.getRouter().navTo("object", { objectId: oItem.getBindingContext().getProperty("ProductID") });

But what are the possibilites if I like to provide additional ProductIDs to the navTo method?

View Entire Topic
former_member592880
Participant

hii,

in the manifest setup your navigation like this where the request number is the value carrier:

{
  "name": "master",
  "pattern": "MasterPage1/{requestNumber}",
  "target": [
    "MasterPage1",
    "DetailPage1"
  ]
}

then in your page one code this:

onPress: function(oEvent) {
	 var that = this;
	 var oItem;
	 oItem = oEvent.getParameter("listItem").getProperty("title");
	 var oRouter = sap.ui.core.UIComponent.getRouterFor(that);

	 oRouter.navTo("detail", {
	  requestNumber: oItem
	 });
},

in page 2 in the onInit function:

var oRouter = sap.ui.core.UIComponent.getRouterFor(that);
oRouter.getRoute("detail").attachPatternMatched(that._onObjectMatched, that);

_onObjectMatched: function(oEvent) {
	  var that = this;
	  that.getView().bindElement({
	   path: "/" + oEvent.getParameter("arguments").requestNumber,
	   model: "mList"
 });


this is for a single value that i had programmed you add more values to it in the manifest and transfer them to the next page

regards

Siddharth