Skip to Content
1
Former Member
Jul 17, 2013 at 06:50 AM

Read data from input i.e.,sap.m.Input

924 Views

Hi,

I am trying to develop a simple mobile app that involves sap.m.input .I have gone through API references for the same but there is no api for reading data from input. My code is as follows :

sap.ui.jsview("myfirstmobile.MobileView", {

getControllerName : function() {

return "myfirstmobile.MobileView";

},

createContent : function(oController) {

this.setHeight("100%");

var flexbox=new sap.m.FlexBox({direction:"Column",height:"150px"});

flexbox.addItem( new sap.m.Input("un",{placeholder:"Enter UserName"}));

flexbox.addItem( new sap.m.Input("pass",{type:sap.m.InputType.Password,placeholder:"Enter Password"}));

flexbox.addItem( new sap.m.Button('login',{text:"Log In",

press:[oController.buttonClicked]}));

flexbox.setAlignItems("Center");

flexbox.setJustifyContent("Center");

var page1 =new sap.m.Page("page",{

title: "LOG IN",

icon: "http://www.sap.com/global/ui/images/global/sap-logo.png",

content:flexbox,

});

return page1;

}

});

Could you please tell me how to read data from input field in mobile application i.e.,username .