View Full Version : setStyleAttribute does now work on a window with gxt-all.css included

26 Apr 2011, 12:40 PM
I created a simple GXT app that simply adds a new GXT window to the rootpanel.
The setStyleAttribute works when I include gxt-gray.css in the corresponding html file.
But now when I include the gxt-all.css, the new style does not work.
I inspected the elements using firebug and the style is there.
But does not seem to take effect.

Any help would be appreciated.

package com.example.myproject.client;

import com.extjs.gxt.ui.client.widget.Window;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

* Entry point classes define <code>onModuleLoad()</code>.
public class TestWindow implements EntryPoint {

* This is the entry point method.
public void onModuleLoad() {
Window w = new Window();
w.setStyleAttribute("background-color", "red");

28 Apr 2011, 9:24 AM
I noticed one more thing. The background color flashes red(the color I am explicitly setting)
briefly and then becomes blue again.

18 Oct 2011, 3:05 AM
Did u find any luck with this? I am also having the same issue.

28 Dec 2011, 9:23 AM
I've just found that since upgrading to GWT2.4 (from 2.1) my setStyleAttribute calls no longer work.

FYI, I figured my problem out. Part of my upgrade to GWT2.4 was to change my html dtd to:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">and I discovered the attribute that was broken was not a web safe color. So it just ignored it.