Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

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

    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

    Add comment
    10|10000 characters needed characters exceeded