Hello!
Im trying to find a solution too and I stop on your resolving way: static boolean in the widget and injection by StyleInjector. But invoking "StyleInjector.inject( style.getText(), true );" force inject styles and after few moments styles injected again! It happens because "uiBinder.createAndBindUi(this)" invoke "style.ensureInjected()", that invoke "StyleInjector.inject( style.getText(), FALSE );" that add style injection to the queue in the "StyleInjector". Fortunately StyleInjector provide flush() method...
And final solution is:
@UiField
Style style;
private static boolean styleInjected = false;
public SomeWidget() {
widget = uiBinder.createAndBindUi(this);
if (!styleInjected) {
styleInjected = true;
StyleInjector.flush();
}
}
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/fvKhIYlWinEJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment