Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3353

Re: Passing values using pages in Application

$
0
0

Hi Mohanty,

 

If you're using sap.m.NavContainer / sap.ui.core.Routing.Router for the Navigation, you can pass parameters from first view using .to / .navTo method -


In First Page -

 

// For sap.m.NavContainer
.to("secondView","slide",{Mode:"ViewInspectionNotifications",Notification:"210004532",DefectItem:"0003"});
// For sap.ui.core.Routing.Router
.navTo("secondView",{Mode:"ViewInspectionNotifications",Notification:"210004532",DefectItem:"0003"});

secondView will be your view name

slide is the transition name

Mode,Notification and DefectItem are the parameters that I am passing from first view to second view. Once you pass them from first view, you have to fetch those parameters in second view.

 

In Second Page -

 

this.addEventDelegate({  onBeforeShow: function(event) {  var params = event.data;  if(params.Mode == "ViewInspectionNotifications"){  var selectedNotificationNo = params.Notification;  //You can fetch "210004532" which is passed from first view  var selectedDefectItem = params.DefectItem;      //You can fetch "0003" which is passed from first view       }  }
}, this);

Alternatively, you can try using a global JSON model for whole application and store the data using sap.ui.getCore().getModel().setProperty() method in first view and you can fetch those parameters in second view using sap.ui.getCore().getModel().getProperty() method.

 

Regards,

Sai Vellanki.


Viewing all articles
Browse latest Browse all 3353

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>