Skip to Content
0
Former Member
Mar 09, 2017 at 08:26 AM

couldn't use this.getView() in button press function

1348 Views

Hi Professionals,

I couldn't use this.getView() and .getValue() in my button press, why ??

here is my button code

var updatebtn = new sap.m.Button({
text: "Update",
press: function(){
var tem = {};
tem.DISHESID = this.getView().byId("browniesiddialoginput").getValue();
tem.DISHESNAME = this.getView().byId("browniesnamedialoginput").getValue();
tem.DISHESDESC = this.getView().byId("browniesdescdialoginput").getValue();
tem.DISHESPRICE = this.getView().byId("browniespricedialoginput").getValue();
}    
});

and this is the error I get

Uncaught TypeError: this.getView is not a function

Thanks.