-
29 Aug 2011 2:07 AM #1
Answered: Setting a theme
Answered: Setting a theme
Hello,
From what I read, the setting of the theme for an application is done only in the Entrypoint class. I tried setting it in other places, but it had no effect.
Is there any way I can set it somewhere else except the Entrypoint? Because I am loading some user preferences and the loading does not take place in the Entrypoint.
Thanks in advance,
Anda
-
Best Answer Posted by micgala
Hi.
I use a menu for setting the style. The styles can be changed at any time.
This is how I do the chage:
Where newThemeUrl contains the path to one of the gxt css files (gxt-all.css, gxt-gray.css, or xtheme-slate.css, for example).PHP Code:CSS.removeStyleSheet("gxt_theme");
CSS.addStyleSheet("gxt_theme", newThemeUrl);
-
30 Aug 2011 5:55 AM #2
Hi.
I use a menu for setting the style. The styles can be changed at any time.
This is how I do the chage:
Where newThemeUrl contains the path to one of the gxt css files (gxt-all.css, gxt-gray.css, or xtheme-slate.css, for example).PHP Code:CSS.removeStyleSheet("gxt_theme");
CSS.addStyleSheet("gxt_theme", newThemeUrl);
-
30 Aug 2011 10:29 AM #3
Hi,
Thank you for the answer, but I was looking for a Java code sample for this.
-
30 Aug 2011 11:09 PM #4
That is exactly what I pasted you...
CSS is a GXT class.
Regards,
Michel.
-
31 Aug 2011 12:27 AM #5
Yes, you are right, it is a GWT class. But now my question would be: how to link the "id" that has to be passed to the remove and add stylesheet methods to the actual path of the .css file? I see that the add method has a url in its parameter list, but how does the remove know what to remove?
Thanks in advance
-
31 Aug 2011 12:38 AM #6
"gxt_theme" is the id used by gxt... so simply stick with that.
Removing the style "gxt_theme" will remove the current theme.
Simply then add the new one using also that id.


Reply With Quote