0

I have this style in my uibinder:

<ui:style type="com.mycompany.MyApp.MyStyle">
      .something {
             width: 50em;
       }

    div.dm {
        float: left;
        display: inline-block;
        width: 50em;
    }

     .test-name {
        margin: 10px 10px;
    }       
</ui:style>

This is the interface for the resource:

    interface MyStyle extends CssResource {
        @ClassName("something ")  //This doesn't work either
        String somethingClass();
//        String something(); //This works!
        @ClassName("div.dm")
        String divClass();
        @ClassName("test-name")
        String testNameClass();
      }  

But then i get this error:

  [ERROR] div.dm: Fix by adding .something{}
  [ERROR] div.dm: Fix by adding .div.dm{}
  [ERROR] test-name: Fix by adding .test-name{}
  [ERROR] Generator 'com.google.gwt.resources.rebind.context.InlineClientBundleGenerator' threw an exception while rebinding 

Anybody have any idea? I am using GWT 2.4.

2 Answers 2

2

(Deleted previous answer, didn't make sense in this context).

It looks like this is a bug (or intended?). In the GWT issue tracker are several reports somewhat related: Capitalized classnames used in @ClassName within doesn't work and Non-Java method safe characters in inline class names doesn't work the latter has state fixed, but also has a comment remarking to make ClassName work. This comment was before the fixed issue, so it's not clear if it was intended to be fixed, or it was fixed, but doesn't work.

ClassName only seems to work in the following combination:

@ClassName("test-name")
String testName()

and in css:

.test-name {
}

The way to go seems to be use the same name in method/ui:style or use the dash/camelcase combination.

Sign up to request clarification or add additional context in comments.

Comments

1

In your div.dm selector, the class name is dm, so @ClassName("dm").

I unfortunately don't understand about the test-name; let's hope it's a side-effect of the first error ;-)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.