on 2014 Oct 15 6:45 AM
Hi,
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?
Request clarification before answering.
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});
sap.ui.getCore().setModel(crModel);
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");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.