Showing results for 
Search instead for 
Did you mean: 

Passing value from one view to another view in SAP UI5

0 Kudos


I am new to SAP UI5.I am trying to pass a value one view to another in same app.

How do I do that?

suppose I have a input field in view1.js and I want to show the user entered value to the next view View2.js..

now how to do that?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

Hello Dipjyoti,

Create a global model data inside a view

var crModelData = {IntialName:" ", FinalName: " "}

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

  crModel.setData({globalData : crModelData});


Map the text field's you need to pass from first view to Json model created and click on button to navigate to second view.

var oTextView = new sap.ui.commons.TextView("textView", {

  text: "{/IntialName}",

  tooltip: "First Name"


In second view access the global model with function

var crModel = sap.ui.getCore().getModel();

    var FirstName= coreModel.getProperty("/globalData/IntialName");