I would like to share a CSS across multiple widgets using <ui:with> by
following the example below:

http://code.google.com/intl/zh-TW/webtoolkit/doc/latest/DevGuideUiBinder.html#Using_an_external_resource

I can see that css class name are obfuscated but the class definition
is not showing up when I inspect the element in firefox / chrome.

Here're my codes.  Can anyone suggest what am I missing?  Thanks.

Style.css
.nameSpan {  color: #3E6D8E; background-color: #E0EAF1;}

Resources.java
public interface Resources extends ClientBundle {
  @Source("Style.css")
  Style style();

  public interface Style extends CssResource {
    String nameSpan();
  }
}

uibinder.ui.xml
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
    xmlns:g='urn:import:com.google.gwt.user.client.ui'>
  <ui:with field='res' type='com.my.app.widgets.logoname.Resources'/>
  <g:HTMLPanel>
      <div>
        Well hello there
        <span class='{res.style.nameSpan}'>Kevin</span>
      </div>
  </g:HTMLPanel>
</ui:UiBinder>

uibinder.class
public class uibinder extends Composite {
        private static uibinderUiBinder uiBinder =
GWT.create(uibinderUiBinder.class);
        interface uibinderUiBinder extends UiBinder<Widget, uibinder> {}
        @UiField(provided = true)  final Resources res;  // the style doesn't
show no matter provided=true is declared or not.
        public uibinder(Resources res) {
                res = GWT.create(Resources.class);
                initWidget(uiBinder.createAndBindUi(this));
        }
}



-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to