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 15:30 |
Tom Bauwens Messages: 10 Registered: May 2012 |
Junior Member |
|
|
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 10:15 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
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 10:56 |
|
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/
|
|
| |
Goto Forum:
Current Time: Tue Apr 23 08:19:29 GMT 2024
Powered by FUDForum. Page generated in 0.03938 seconds
|