Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

xml view add multiple class values doesn't detect class in controller

$
0
0

Hi Experts,

 

I am using xml view
eg: <label id="lblCustomerName" text="Hi Jhon" class="custTitle hidden"/>
I have specify two classs "custTitle" (actual css for label) and "hidden" (hide label). On button click I have to check if label has class hidden then remove that class other wise add "hidden" class.
but on button click event in controller

showHideLabel : function(event){
var lbl = this.getView().byId("lblCustomerName") if( lbl.hasStyleClass("hidden") // it always return false.  lbl.removeStyleClass("hidden")
else   lbl.addStyleClass("hidden")
}

hasStyleClass never return true.  when I check control it show StyleClassArray with one value as  "custTitle hidden" it treat two class added in view as single class. Is there any ways to that xml will create separate entry for added classes in xml view.
Also I don't want to detect it using DOM(Jquery) as when I refresh view it bind value from control hierarchy which reset Dom manipulation.

 

 

 

Thanks in advanced


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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