Skip to Content
0

How to read value of Input feild in SAP UI5 application developed at Eclipse

Sep 13, 2017 at 12:42 PM

20

avatar image
Former Member

hi guys,

Am new to SAP UI5 as am developing SAP UI5 application in eclipse , am stuck with reading an input feild value , please assist.

i used

var i = sap.ui.getCore().byId("un");

var Ivalue =I.getValue();

but it did not work

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Sep 13, 2017 at 02:37 PM
0

Hi,

Inside the controller of view, use this.getView().byId() to fetch any control by passing the id which you declared while creating view.

var oInput=this.getView().byId("idInput");

Actually when you give id to any control while creating view, then UI5 framework prefixes this id with the id of view, so if you are using sap.ui.getCore().byId() function to fetch any control then you have to specify the complete id of control (along with the prefix). That's why we always use this.getView().byId().

To know more about these prefixes, please go to https://sapui5.hana.ondemand.com/ site.

Regards,

Rahul

Share
10 |10000 characters needed characters left characters exceeded