Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2695

Re: usage of onBeforeRendering vs onafterRendering

$
0
0

Hi Jhon,

 

i just told you the one usage of onafterrendering to clarify your thoughts on  onBeforeRendering and onafterRendering and yes onafterRendering is used for many other purposes also.As far as you said we can read model and do validations in onBeforeRendering let me clarify you more that yes you can read model (as it has nothing to do with rendering) but no validation on controls can be performed in onbeforerendering because when onbeforerendering method is triggered the controls are not even rendered so if you try to access any control  using sap.ui.getCore().byId('abcd') then it will give you error that no id found this is because controls are not yet rendered.

so it can only be done in onafterrendering because onafterrendering will only triggered once all the controls are rendered and then you can do anything with control( i.e,doing any kind of validations,changing properties of any control  ,hiding any control etc).

 

Hope it helps.

 

Thanks and Regards,

Umer Siddique


Viewing all articles
Browse latest Browse all 2695

Trending Articles



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