How to addStyleNames "Multiple css classes" into 1 element in UiBinder in GWT?
Asked Answered
W

2

6

I have the need to apply many separated CSS classes into 1 element in UiBinder in GWT, but don't know how to do it.

In my TestView.ui.xml, i have

<g:Button  text="Log Out"  ui:field="logoutButton" addStyleNames="{style.gwt-Button}" addStyleNames="{style.paddedRight}" />

but it generated run-time error.

Then I tried

<g:Button  text="Log Out"  ui:field="logoutButton" addStyleNames="{style.gwt-Button style.paddedRight}" />

This time I got compile time error.

So, How to addStyleNames "Multiple css classes" into 1 element in UiBinder in GWT?

No info found on internet.

Wartime answered 19/9, 2013 at 4:55 Comment(0)
U
14

I Think you have to specify each style name in addStyleNames property in a separate bracket pair.

Something like this:

<g:Button  text="Log Out"  ui:field="logoutButton" addStyleNames="{style.gwt-Button} {style.paddedRight}" />
Umbilical answered 19/9, 2013 at 5:13 Comment(0)
T
0

The docs example here uses single inverted commas.

<g:PushButton addStyleNames='{style.pretty} {style.hot}'>Push my hot button!</g:PushButton> 

Double inverted commas don't work in my app (GWT 2.6)

Tenedos answered 14/5, 2015 at 16:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.