I have a view which I create a new button. I'm using a JSONModel to bind data to the button like so:
var btnCall = new sap.m.Button('btnCall' { text: "{PHONE}", press: [oController.onCall, oController]});
Not all records have a phone number, in that case I want to hide the button (setVisible(false)). Can you folks provide or point me to an example that does this? In the view, I tried to read the button text with getText(), but it's empty, I think because the data is binded after the view renders. This seems so simple, but I'm missing something.
I should have prefaced, I'm new to MVC and OOP. Any help would be greatly appreciated.