Hi gwitters,

Before filling any issue, just want to be sure that it's a bug.
Here is my ui.xml

<gwt:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
    xmlns:gwt='urn:import:com.google.gwt.user.client.ui'>
    <ui:with field='bundle' type='com.somewhere.client.MyExternalBundle'/>
    <ui:style>
    .neverUsed { background-color:red;}
    </ui:style>
<gwt:HorizontalPanel>
<gwt:Label ui:field='label' styleName="{bundle.style.bold}" text="is it a
bug ?"/>
</gwt:UIBinder
</gwt:HorizontalPanel>

MyExternalBundle is pretty simple, it contains a style() method that returns
myCss type (with a bold() function)
When there is no <ui:style> tag in my ui.xml, the line
ensureCssInjected(clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style());
is not generated at the end of createAndBindUI() in the Impl.
I have to explicitly call
com.google.gwt.dom.client.StyleInjector.injectStylesheet(bundle.style().getText())
after my initWidget() to get it working
If I add a dummy never used <ui:style> in the ui.xml, it works perfectly,
ensureCssInjected is added

I have quickly looked into UiBinderParser class, It is probably related to
the findStyles() method witch does not call createStyle() which won't add
ImplicitCssResource in bundleClass object.

any thought ?

Sami

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to