Tum
Tum

Reputation: 3652

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

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.

Upvotes: 6

Views: 8022

Answers (2)

timmacp
timmacp

Reputation: 193

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)

Upvotes: 0

zaerymoghaddam
zaerymoghaddam

Reputation: 3117

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}" />

Upvotes: 14

Related Questions