Monday, July 8, 2013

Re: Problems with overriding .gwt-TabBarItem-selected CSS when using own CSS style instead of .gwt-TabBarItem

GWT has two kind of CSS classes: primary and dependent.

By calling setStyleName() you have replaced all CSS classes on the TabBarItem which your custom one. This makes your custom CSS class the new primary CSS class. When selecting a TabBarItem the implementation calls tabBarItem.setStyleDependentName("selected"). Now each TabBarItem contains class="<primary-css-class> <primary-css-class>-selected" which means you need upper/lowerTabBarItem-selected in your css file.

Instead of setStyleName() you could use addStyleName() which does not replace existing CSS classes and instead adds your custom class name to the element. You maybe need "!important" in your CSS then to make sure no one else overrides your CSS changes defined in your custom class name. That way the primary CSS class name is still "gwt-TabBarItem" and thus ".gwt-TabBarItem-selected" will work.


-- J.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate