As soon as you use ClientBundle with CssResource all css classes defined by
a CssResource are obfuscated (unless you disable it in your gwt.xml file).
That means something like ".SXYDSS" is injected in your website but you
have hardcoded "quite" in your cell. Obviously this wont work.
So you have to call CellTableStyle.quiet() and put the output (the method
returns the obfuscated class name) into the class attribute of <em>. As
SafeHtmlTemplates are defined through annotations and you cant access
CssResource methods in a static way you have to make your class attribute
value a method parameter [and you probably have to use SafeStyles (see
SafeStyleUtils and SafeStyleBuilder)], e.g.
@SafeHtmlTemplate(....<em class=\"{2}\"> ....)
SafeHtml template(SafeHtml first, SafeHtml second, String cssClass);
or if GWT complains because of a variable as class attribute value:
@SafeHtmlTemplate(....<em class=\"{2}\"> ....)
SafeHtml template(SafeHtml first, SafeHtml second, SafeStyles cssClass);
-- J.
Am Dienstag, 6. März 2012 17:10:41 UTC+1 schrieb Shaun Tarves:
>
> Hi -
>
> I have a custom cell definition that I want to add a custom style
> definition (.quiet) for. In this case, it's a cell that goes into a cell
> table. What I have done (and is NOT working) is the following:
>
> interface CellTableResources extends CellTable.Resources {
>
> @Source({CellTable.Style.DEFAULT_CSS, "DesktopServiceTable.css"})
>
> CellTableStyle cellTableStyle();
>
> }
>
> interface CellTableStyle extends CellTable.Style {
>
> String quiet();
>
> }
>
> I added a .quiet{} rule to my DesktopServiceTable.css
>
> Then, the render() method of my cell class uses the "quiet" class: @
> SafeHtmlTemplates.Template("<strong>{0}</strong><br/><em
> class=\"quiet\">Updated: {1}</em>")
>
> The class name is on the em element in the DOM (within the td of the
> table), but there is no style associated with it - it's almost like it
> wasn't "injected" or something.
>
>
> Any ideas?
>
Am Dienstag, 6. März 2012 17:10:41 UTC+1 schrieb Shaun Tarves:
>
> Hi -
>
> I have a custom cell definition that I want to add a custom style
> definition (.quiet) for. In this case, it's a cell that goes into a cell
> table. What I have done (and is NOT working) is the following:
>
> interface CellTableResources extends CellTable.Resources {
>
> @Source({CellTable.Style.DEFAULT_CSS, "DesktopServiceTable.css"})
>
> CellTableStyle cellTableStyle();
>
> }
>
> interface CellTableStyle extends CellTable.Style {
>
> String quiet();
>
> }
>
> I added a .quiet{} rule to my DesktopServiceTable.css
>
> Then, the render() method of my cell class uses the "quiet" class: @
> SafeHtmlTemplates.Template("<strong>{0}</strong><br/><em
> class=\"quiet\">Updated: {1}</em>")
>
> The class name is on the em element in the DOM (within the td of the
> table), but there is no style associated with it - it's almost like it
> wasn't "injected" or something.
>
>
> Any ideas?
>
--
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/-/FnQpCwkjLH0J.
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.