addStyleName in java code

27 views
Skip to first unread message

JanaN

unread,
Feb 8, 2017, 5:22:15 AM2/8/17
to GwtBootstrap3
I had to change the background color of a panel header on click of a button.
So, I declared by styles in *.ui.xml file and 
in the jave class, i'm calling panelHeaderUiField.addStyleName. But this is not reflecting.
If I use setStyleName, it's clearing the existing style but not applying the new style.

is there a way to do that? I'm using UIBinder.

Thanks

JanaN

unread,
Feb 8, 2017, 4:25:13 PM2/8/17
to GwtBootstrap3
I got it done using

panelHeaderUiField.getElement().getStyle().setBackgroundColor("...")

Dhinakar Reddy Pothireddi

unread,
Feb 8, 2017, 4:29:11 PM2/8/17
to JanaN, GwtBootstrap3
Just copy the style to the main css file. It would work. The styles in the ui.xml file can be used only by the widgets on loading itself. Call the setStyleName from the java file.

--
You received this message because you are subscribed to the Google Groups "GwtBootstrap3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gwtbootstrap3+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/gwtbootstrap3.
To view this discussion on the web visit https://groups.google.com/d/msgid/gwtbootstrap3/143e9e71-45d0-4321-8174-760e74729886%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages