Quantcast
Channel: SCN: Message List - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 8124

Re: UI5 - Enable Button on XML View

$
0
0

Hi,

 

So this is possible programatically (but not recommended) by using

 

sap.ui.getCore().byId("idViewRoot--idViewDetail--rejectButton")

This should get you the button object.

 

Note that you have to specify the id of not only the button but also the view hierarchy it is placed withing (idRootView => idViewDetail) so if you move the button or change any higher up ids, then you have to change the code.

 

Using a local state JSON model, as suggested, is preferable and you can bind other things to the semantic action of enabling the button if needed with no more code. You also have the freedom to change the UI from the button logic and it makes use of the framework to do all the heavy lifting.

 

Hope this helps!

 

Oli


Viewing all articles
Browse latest Browse all 8124

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>