Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add class name to element in uibinder xml file

Tags:

java

gwt

uibinder

The following replaces any current css class names. It appears to call setStyleName.

<g:DecoratorPanel styleName="{style.myCssClass}">

What I really want to do is add a class name, like calling addStyleName.

Is it possible to do what I'm attempting?

like image 402
antony.trupe Avatar asked Dec 14 '09 05:12

antony.trupe


1 Answers

Use addStyleNames in such situations, like this:

<g:DecoratorPanel addStyleNames="{style.myCssClass}">

It's a little trick I picked up on the GWT's Google Group - too bad it's not (?) mentioned in the official documentation.

PS: I'm actually missing a really comprehensive documentation for UiBinder. I grepped the GWT sources for addStyleNames and found this file: WidgetBasedUi.ui.xml - it seems to contain some interesting use cases for UiBinder, including the one with addStyleNames.
If someone knows any other good/secret references for UiBinder, please share :)

like image 166
Igor Klimer Avatar answered Oct 11 '22 05:10

Igor Klimer