Value Pasing from master to detail page

value passing 

 From Master to detail Page / one page to another page


sending value from master page (master.controller.js) :

  • suppose u want to send master tittle to detail objectheader page
  • first take value of tittle in one variable ( which is var v)
  • if u r using master detail then value in lastupdatefinish event
  • var v1 = this.getView().byId("list1").getItems()[0].getTitle();  (master.controller.js)
oRouter.navTo("Package",{v:v1}

( in the above navto  we passing v1 value through variable v )
  • pass the same value from manifest.json 


 "subroutes": [{
                        "pattern": "pkg/{v}",
                        "name": "Package",
                        "view": "Package",
                        "controlAggregation": "detailPages"
                    }]


  • currently we r passing value from view package.


receiving value in package page (package.controller.js) :

  • if u want to display value in (package.view.xml) page then first create one objectheader here

<ObjectHeader
id="incDataSet"
backgroundDesign="Solid">
</ObjectHeader>

  • then get value through package.controller.js and set to id incDataSet
 onInit : function() {

  var oRouter=sap.ui.core.UIComponent.getRouterFor(this);
  oRouter.getRoute("Package").attachPatternMatched(this._Matched,this);

 },
 _Matched:function(e){
var a=e.getParameter("arguments").v;
  var x=this.getView().byId("incDataSet");
  x.setTitle(a);
},


done with value passing..!







Post a Comment

Previous Post Next Post