I'm on 2.0.3 and I've been getting this.

It works in production mode, but not in dev mode

Adding styles in the ui.xml file using

   - ui:style
   - addStyleNames

or in the java file using

   - elem.setClassName("classname");
   - elem.getStyle().setBackgroundColor("blue");

doesn't work if you are using runAsync or LazyPanel

but it does work with class="classname" and style set in an app-wide css
file

Ian

http://examples.roughian.com


On 6 April 2010 06:22, Andrew Hughes <[email protected]> wrote:

> I think this was a bug, try 2.0.3 and please let others know if this fixes
> your problem :)
>
>
> On Tue, Apr 6, 2010 at 6:05 AM, lineman78 <[email protected]> wrote:
>
>> I just compiled this and the problem seems to only exist in hosted
>> mode.
>>
>> On Apr 5, 2:25 pm, lineman78 <[email protected]> wrote:
>> > I am using the UIBinder sample code that is generated by eclipse and I
>> > have run into one minor problem.  The CSS is not being injected.  Here
>> > is the code:
>> >
>> > <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent";>
>> > <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder">
>> >         <ui:style>
>> >                 .important {
>> >                         font-weight: bold;
>> >                 }
>> >         </ui:style>
>> >         <div>
>> >                 Hello,
>> >                 <span class="{style.important}" ui:field="nameSpan" />
>> >         </div>
>> > </ui:UiBinder>
>> >
>> > public class SubModulePanel extends UIObject {
>> >         private static SubModulePanelUiBinder uiBinder = GWT
>> >                         .create(SubModulePanelUiBinder.class);
>> >
>> >         interface SubModulePanelUiBinder extends UiBinder<Element,
>> > SubModulePanel> {
>> >         }
>> >
>> >         @UiField
>> >         SpanElement nameSpan;
>> >
>> >         public SubModulePanel(String firstName) {
>> >                 setElement(uiBinder.createAndBindUi(this));
>> >                 nameSpan.setInnerText(firstName);
>> >         }
>> >
>> > }
>> >
>> > getFrontEndRootPanel().getElement().appendChild(
>> >                                 new SubModulePanel("Plugin 1; Instance:"
>> >                                                 +
>> getArgs().get("Instance")).getElement());
>> >
>> > I checked it with firebug and it does have an obfuscated class name,
>> > but the CSS is never injected.  I don't know if it matters but all
>> > this is called through a runAsync.  Is there a way to inspect the
>> > generated classes with eclipse?  I tried to inject the CssResource
>> > into the SubModulePanel class so I could inject it manually, but also
>> > had problems with that.
>>
>> --
>> 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]<google-web-toolkit%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>>
>  --
> 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]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

-- 
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