I am wondering what would be the requirement for this? Is it for SplitApp Controls's 'Back' button in Detail page? For Phone an Desktop scenarios? If yes, there is an easy way to do that.
If not, you may do binding for the 'visible' property of the button. Example:
oControl = new sap.m.Button({
text: "{PHONE}",
visible: {
path:"PHONE",
formatter: function(fValue) {
if (fValue)
return true;
else
return false.
}
}
});