That's fine if you have a reference to an external stylesheet, I was getting GWT to process my css though and was then including that via ensureInjected(). a number of methods in StyleSheetLoader are deprecated because of IE oddities. We actually ended up writing some custom code to process the head element and modify the style elements that way, seems to work fine...
On Mar 2, 1:03 am, Peter Simun <[email protected]> wrote: > HiJonathan, > > you can use StyleSheetLoader from GWT > showcase:http://code.google.com/p/google-web-toolkit/source/browse/trunk/sampl... > > This allows you to load stylesheets at the runtime. > Peter > > On Mar 2, 8:07 am, "[email protected]" > > <[email protected]> wrote: > > Hi all, > > > I've built a themeable GWT application that uses specific theme > > stylesheet (lets call then themeA.css and themeB.css) on top of a > > common set of css styles. On application start I can inject a > > stylesheet using: > > > ThemeA themeA = GWT.create(ThemeA.class); > > themeA.ensureInjected(); > > > and this happily stuffs a style element into the head section of the > > DOM. However, I need to replace the stylesheet (because the user can > > switch between various themes). My original thought was to do the > > following: > > > StyleElement el = new StyleElement(); > > el.setId("customtheme"); > > el.setInnerText(themeA.getText()); > > getHead().append(el); > > > and then be able to remove the style element using the id to locate > > it. At present, this work in Firefox but throws all kinds of Runtime > > exceptions under Internet Explorer (will post the exact issue > > tomorrow). > > > Can anybody suggest a workaround for this, or an alternative method to > > replace stylesheets in an application dynamically? > > > Many thanks, > > Jon. > > -- 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.
