Skip to Content
0
Former Member
Dec 09, 2014 at 11:10 PM

Bar id using this.byId() gives error when try to set its vibility

270 Views

hi,

i've a bar declaration in my xml.view like below:

<m:Bar id="idBar" visible="false"> <m:contentRight > <m:Button id = "idBtnAddCart" text = "Submit" type = "Emphasized" icon = "sap-icon://cart" press = "pressSubmit" visible="true" > </m:Button> </m:contentRight> </m:Bar>

and i've below on one of the actions:

this.byId("idBar").setVisible(true);

and when clicked on the action button, it shows me:

Uncaught TypeError: Cannot read property 'id' of undefined

can i set visibility on BAR <Mobile>? is it valid to do that? other ui controls works.. but not BAR.

i've anyways handled it in a different way, but wanted to know why its giving error.