I am trying to get the input value, but when I call the function I get the error this.getView() is not a function
Below is the function in controller
handleConfirmationMessageBoxPress: function(oEvent) {
var bCompact = !!this.getView().$().closest(".sapUiSizeCompact").length;
MessageBox.confirm(
"Deseja confirmar a transferência?", {
icon: sap.m.MessageBox.Icon.SUCCESS,
title: "Confirmar",
actions: [sap.m.MessageBox.Action.OK, sap.m.MessageBox.Action.CANCEL],
onClose: function(oAction) {
if (oAction == "OK"){
var loginA = this.getView().byId("multiInput").getValue();
alert(loginA)
MessageToast.show("Transferência efetuada");
}else{
// MessageToast.show("Transferência não cancelada");
}
},
styleClass: bCompact? "sapUiSizeCompact" : ""
}
);
}
And here is the input in the view
<m:Input id="multiInput" value="teste" placeholder="Clique no botão ao lado para buscar o usuário" showValueHelp="true" valueHelpRequest="valueHelpRequest" width="auto"/>