Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8117743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:16:21+00:00 2026-06-06T04:16:21+00:00

I want to put all my resources into a ClientBundle for easy management. So

  • 0

I want to put all my resources into a ClientBundle for easy management. So I first started working on putting a single css file, which is also the file under /war directory, into ClinetBundle. However the style cannot be rendered in my output, but if I just put the css file under /war without ever using the css ClientBundle, the program worked just fine.

Below is my simple test case (using ClientBundle) – I put the css file same folder in the client package and remove css file under /war directory:

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.CssResource.NotStrict;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;

public class Test implements EntryPoint {

    private static final int REPORT_TITLE_HEIGHT = 50;
    public static final MyResources INSTANCE = GWT.create(MyResources.class);

    public interface MyResources extends ClientBundle {
        @NotStrict
        @Source("Test.css")
        CssResource css();
    }

    public void onModuleLoad() {

        INSTANCE.css().ensureInjected();

        Window.enableScrolling(false);
        Window.setMargin("0px");

        VLayout vl = new VLayout();
        vl.setWidth100();
        vl.setHeight100();

        HLayout reportTitleBar = new HLayout();
        reportTitleBar.setHeight(REPORT_TITLE_HEIGHT);
        reportTitleBar.setStyleName("report-title-bar");

        vl.setMembers(reportTitleBar);

        RootPanel.get().add(vl);
    }
}

The style cannot be rendered.

Another simple case – without using css ClientBundle and put back the css file into /war folder.

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;

public class Test implements EntryPoint {

    private static final int REPORT_TITLE_HEIGHT = 50;

    public void onModuleLoad() {

        Window.enableScrolling(false);
        Window.setMargin("0px");

        VLayout vl = new VLayout();
        vl.setWidth100();
        vl.setHeight100();

        HLayout reportTitleBar = new HLayout();
        reportTitleBar.setHeight(REPORT_TITLE_HEIGHT);
        reportTitleBar.setStyleName("report-title-bar");

        vl.setMembers(reportTitleBar);

        RootPanel.get().add(vl);
    }
}

The style can be correctly rendered.

And my Test.css code:

.report-title-bar {
    /* IE10 Consumer Preview */
    background-image: -ms-linear-gradient(top left, #FFFFFF 0%, #00A3EF 100%);
    /* Mozilla Firefox */
    background-image: -moz-linear-gradient(top left, #FFFFFF 0%, #00A3EF 100%);
    /* Opera */
    background-image: -o-linear-gradient(top left, #FFFFFF 0%, #00A3EF 100%);
    /* Webkit (Safari/Chrome 10) */
    background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0, #FFFFFF), color-stop(1, #00A3EF));
    /* Webkit (Chrome 11+) */
    background-image: -webkit-linear-gradient(top left, #FFFFFF 0%, #00A3EF 100%);
}

What is the issue here, anyone please shed me some light on it. Appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:16:22+00:00Added an answer on June 6, 2026 at 4:16 am

    If you put your css files into a clientbundle your css files have to be parsed by the GWT Compilers CSS Parser, which currently bases on an old version which is somewhat a little hacked. (This is going to change in the future though)

    For the parser to work you need to escape your background values like this:

    background-image: literal('-webkit-linear-gradient(top left, #FFFFFF 0%, #00A3EF 100%)');
    

    There are some other quirks that also need escaping. Take a look in the docs and search for escaping: https://developers.google.com/web-toolkit/doc/latest/DevGuideClientBundle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to put all the requirements of a repoze Zope2 install in a
I want to find all img tags in a string of text and put
Put simply, I want to select all data in two columns from each of
i want to put the id into the colorbox below this code nom works
I've put all of my application's ResourceDictionaries into a separate assembly and merged them
I've projected an Intranet Ajax application and I want put it in a full
hey, hi i want put limit on object creation means a class can have
I want to put a sharpen filter on an image. I have found a
I want to put the user password check to never expire. When I create
I want to put a conditional breakpoint in windbg. For example lets say LoadLibrary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.