cancel
Showing results for 
Search instead for 
Did you mean: 

Multi odata can pass in a single event.

former_member187227
Participant
0 Kudos

Hi Everyone,

          I am Vinothkumar new to SAP ui5 frontend development so please help me to learn this..

How to pass the two oData content to the next screen using the press event. The first oData content will show in the header and the second oData content will show in the list item.

Accepted Solutions (0)

Answers (1)

Answers (1)

aakash_neelaperumal2
Active Participant
0 Kudos

Hi Vinoth,

You can pass values from one view to other as shown below.

View 1 controller

Before navigating to other view you can use below command to set a model.

sap.ui.getCore().setModel(View1Model,"View1Model");

View2 controller

Now in this 2nd view inside below std. function, you can access the data from the model.

_handleRouteMatched:function(evt){

var View2Model = sap.ui.getCore().getModel("View1Model");

}

Now this var View2Model can be accessed in other functions of this controller.

former_member187227
Participant
0 Kudos

Hi Aakash,

          Let me try this idea and let you know. Thanks for your kind response.

former_member187227
Participant
0 Kudos

Hi Aakash,


          when i press a list i want to call two oData. Now i complete for first oData it shows the data in the next view in that same view i want show the next oData content.


listpress1:function(oEv){

  var control=oEv.getSource().getContent()[7].getText();

  var url3="proxy/http/static-71-170-170-213.dllstx.fios.verizon.net:8000/sap/opu/odata/sap/ZCUSTOMER_COLLECTIONS_SRV/CUST_BILLING_HEADER/?$filter=Billing eq '"+control+"'";

  var oModvoi=new sap.ui.model.odata.ODataModel(url3,false,"supervisor","welcome1");

  oModvoi.read('',null,null,true,function(oData,oResponse){

  var oModelv=new sap.ui.model.json.JSONModel();

  oModelv.setData(oData);

  sap.ui.getCore().setModel(oModelv);

  page4.setModel(oModelv);

  });