I have UI5 button. This button is set to visible, based on certain data coming from backend.
Hence, I have set visibility of button in onDataReceived function in controller file.
<Button id="idButton" visible="{HoldButtonVisiblity>/HoldButtonVisible}"/>
Code in controller:
onDataReceived: function (oEvent) {
var sHoldVisible = aData[0].activeFlag;
if(sHoldVisible) {
//make button visible
} else {
//make button invisible
}
}
This works fine. However, the issue is, when I start the app it takes 3-4 seconds for data to load in worklist view. During this time, the button is still visible to the user. It gets invisible after data is received.
My question is, how can I hide button on app initialization? I tried this piece of code:
<Button id="idButton" visible="false"/>
However, if I give visible=false in the view file, button never becomes visible even if it satisfies conditions to be visible.