Home » Eclipse Projects » Remote Application Platform (RAP) » Theme lost after refresh(When doing refresh the theme goes back to default theme)
Theme lost after refresh [message #988897] |
Mon, 03 December 2012 10:30  |
Eclipse User |
|
|
|
Hi,
I have a standalone RWT application (project as a JEE web app) and I have created a custom theme which is included as a jar and referenced as a Web App Library.
Following is the code inside my configuration class in de configure method.
Map<String, String> properties = new HashMap<String, String>();
properties.put( WebClient.THEME_ID, "MyTheme" );
properties.put( RWT.DEFAULT_THEME_ID, "MyTheme" );
application.addStyleSheet("MyTheme", "theme/mytheme/theme.css");
application.addEntryPoint("/formulier", FormulierEntryPoint.class, properties);
When I run this it works fine and my css is shown ok, but when I refresh the page in the browser, the css is back to the default RAP theme.
How can I solve this? Any help would be much appreciated.
|
|
|
Re: Theme lost after refresh [message #989012 is a reply to message #988897] |
Tue, 04 December 2012 05:15   |
Eclipse User |
|
|
|
Hi Tom,
I've tried a simple RWT Application with a custom theme against RAP 2.0
(master) and it's working fine - theme is preserved on browser refresh
(F5). Here is my application configuration clsss:
public class HelloWorldConfiguration implements ApplicationConfiguration {
public void configure( Application application ) {
Map<String, String> properties = new HashMap<String, String>();
properties.put( WebClient.PAGE_TITLE, "RWT Standalone Example" );
properties.put( WebClient.THEME_ID, "fancy" );
application.addEntryPoint( "/hello", HelloWorld.class, properties );
application.addStyleSheet( "fancy", "theme/fancy/fancy.css" );
}
}
Which RAP version are you using. Could you provide a simple project that
demonstrate the issue?
Best,
Ivan
On 12/3/2012 5:30 PM, Tom Bauwens wrote:
> Hi,
>
> I have a standalone RWT application (project as a JEE web app) and I
> have created a custom theme which is included as a jar and referenced
> as a Web App Library.
>
> Following is the code inside my configuration class in de configure
> method.
>
> Map<String, String> properties = new HashMap<String, String>();
> properties.put( WebClient.THEME_ID, "MyTheme" );
> properties.put( RWT.DEFAULT_THEME_ID, "MyTheme" );
>
> application.addStyleSheet("MyTheme", "theme/mytheme/theme.css");
> application.addEntryPoint("/formulier",
> FormulierEntryPoint.class, properties);
>
> When I run this it works fine and my css is shown ok, but when I
> refresh the page in the browser, the css is back to the default RAP
> theme.
>
> How can I solve this? Any help would be much appreciated.
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
| | | | | |
Re: Theme lost after refresh [message #997628 is a reply to message #997319] |
Mon, 07 January 2013 05:56   |
Eclipse User |
|
|
|
Hi Sergei,
> application.addStyleSheet(RWT.DEFAULT_THEME_ID, "theme/fancy/fancy.css");
>
> I used org.eclipse.rap.design.example.jar in place of Tom's
> zlm.myzlm.rap.design.jar, and bound the custom theme to the default
> theme's ID.
That's not a perfect solution, because it does not overwrite the default
theme, but append to it.
A better approach is to declare a new theme:
application.addStyleSheet( "fancy-theme", "theme/fancy/fancy.css");
and use this theme in your entrypoint:
properties.put( WebClient.THEME_ID, "fancy-theme" );
application.addEntryPoint( "/foo", MyEntryPoint.class, properties );
Regards, Ralf
--
Ralf Sternberg
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: Theme lost after refresh [message #997875 is a reply to message #997628] |
Tue, 08 January 2013 18:06  |
Eclipse User |
|
|
|
Hi Ralf,
Thanks for looking into it. I tried that "official way" in the beginning, but unfortunately the newly added (fancy) theme would appear only at startup, but after the browser refresh the UI fell back to the bluish default. But again, it's all about 1.5, most likely in newer version all works as expected.
Thanks again,
Sergei
|
|
|
Goto Forum:
Current Time: Tue Jul 22 19:37:00 EDT 2025
Powered by FUDForum. Page generated in 0.04520 seconds
|