cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass input box values from one view to next view in Sapui5 ?

former_member198924
Participant
0 Kudos

How to pass input box values from one view to next view in Sapui5 ? please assist me.

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member269453
Participant
0 Kudos

Hi durai...

you simply use getcoreby id("of the textfield in the 2nd view").setText(input value)..

example:

var welcomeUser =  sap.ui.getCore().byId("idoText1").setText("Welcome "+user);

out here: the "idoText1" is the id of the text field that is present on the 2nd page.

          and user = is the input field present in the first page.

Hope it solves your issue.

regards

Dipankar

former_member198924
Participant
0 Kudos

Thank u dipankar, I'll try and let you know.

santhu_gowdaz
Active Contributor
0 Kudos

1st view to 2nd view,

var  oShell= sap.ui.getCore().byId("idShell");

                var secondView= sap.ui.getCore().byId("idsecondView");

                inputValue: sap.ui.getCore().byId('inputMain').getValue()

                oShell.to(secondView, {inputNumb:inputValue});

               

2nd view init method(),

onInit: function() {

view.addEventDelegate({

            onBeforeShow: function(evt) {

       

                var idToRetrieve = evt.data.inputNumb;

                inputNumb = idToRetrieve.getValue();

                alert(inputNumb);

}

former_member198924
Participant
0 Kudos

It will support sapui5 mobile application??

santhu_gowdaz
Active Contributor
0 Kudos

s it may work. try once.

Former Member
0 Kudos

Hi, Use navigation and routing concept to write the application, where in you can pass the values from one view to another view using oRouter.navTo("viewName",{someName : value});

former_member198924
Participant
0 Kudos

Hi  Nagarjun Thanks for reply. I'll check that example and let you know.

Former Member
0 Kudos

It depends upon the mechanism you are using to navigate between views. If you are using routing mechanism , i would suggest you to use data binding Concept.

former_member198924
Participant
0 Kudos

Hi Indrajith Thank you for reply. I'll try and let u know.

PMarti
Active Participant
0 Kudos

Hi Durai, I show you two example:

JS Bin - Example 1

JS Bin - Example 2

Regards,

Pau

former_member198924
Participant
0 Kudos

Hi  Pau Marti, Thanks for reply. I'll check that example and let you know.