In a GWT application i am declaring the .css styles inside the UiBinder (ui.xml)
For example:
<ui:Style>
.input {
background:green;
}
</ui:Style>
And if i declare a Widget inside the UiBinder i reference the Style i was like below:
<g:Button styleName="{Style.input}"/>
which is fine.
My problem is that i want to apply that style in a Widget that i add at run time. For example a text box:
TextBox box = new TextBox();
box.setStyleName("input");
I have tried all the possible compinatations (e.g. "input", "{Style.input}"), but without any luck. I know that GWT compiles the styles inside a UiBinder file so the Widgets end up with something like "class="GLIX78"".
Is there any way i can achieve adding a style which is declared at UiBinder in a Widget at runtime?
Thanks,