Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Tom Bauwens is currently offline Tom BauwensFriend
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 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
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 #989146 is a reply to message #989012] Tue, 04 December 2012 19:50 Go to previous messageGo to next message
Tom Bauwens is currently offline Tom BauwensFriend
Messages: 10
Registered: May 2012
Junior Member
Hi Ivan,

Thanks for replying!
I am using RAP 2.0. My application configuration class looks the same as yours so I think that's ok. Have you put your custom theme as a jar inside the application?

I can send you the project (as it is very simple Smile. To what email address should I send it?

Regards,
Tom
Re: Theme lost after refresh [message #989160 is a reply to message #989146] Tue, 04 December 2012 22:34 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Tom,
please attach your project to your next newsgroup message.
Thanks,
Ivan

On 12/4/2012 9:50 PM, Tom Bauwens wrote:
> Hi Ivan,
>
> Thanks for replying!
> I am using RAP 2.0. My application configuration class looks the same
> as yours so I think that's ok. Have you put your custom theme as a jar
> inside the application?
>
> I can send you the project (as it is very simple :). To what email
> address should I send it?
>
> Regards,
> Tom

--
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 #989225 is a reply to message #989160] Wed, 05 December 2012 09:51 Go to previous messageGo to next message
Tom Bauwens is currently offline Tom BauwensFriend
Messages: 10
Registered: May 2012
Junior Member
Hi Ivan,

The project is too big to post here so I put it on our webserver.
You can download it here: http://www.smartapps.nl/apps/project.zip

Regards,
Tom
Re: Theme lost after refresh [message #989440 is a reply to message #989225] Thu, 06 December 2012 09:09 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Tom,
I've checked your project and I can reproduce the issue with the
included rwt bundle. But the rwt bundle is from RAP 2.0 M1. I've checked
it with the latest nightly build [1] and everything is working fine.
Please upgrade your RWT bundle.

[1] http://www.eclipse.org/rap/downloads/
Best,
Ivan

On 12/5/2012 11:52 AM, Tom Bauwens wrote:
> Hi Ivan,
>
> The project is too big to post here so I put it on our webserver.
> You can download it here: http://www.smartapps.nl/apps/project.zip
>
> Regards,
> Tom

--
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 #997319 is a reply to message #989440] Sat, 05 January 2013 19:00 Go to previous messageGo to next message
Sergei Vasilyev is currently offline Sergei VasilyevFriend
Messages: 5
Registered: January 2013
Junior Member
Hi Ivan,

I've experienced the same issue as Tom had. I reference RAP 1.5 from my maven project (btw, any plans on mavenizing stand-alone (not eclipse-plugin) RWT 2.0?). This code did the trick for me:

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.

Cheers,
Sergei
Re: Theme lost after refresh [message #997628 is a reply to message #997319] Mon, 07 January 2013 10:56 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

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 23:06 Go to previous message
Sergei Vasilyev is currently offline Sergei VasilyevFriend
Messages: 5
Registered: January 2013
Junior Member
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
Previous Topic:RAP Theming and system specific colors
Next Topic:Missing SWT Image Constants
Goto Forum:
  


Current Time: Tue Apr 23 08:19:29 GMT 2024

Powered by FUDForum. Page generated in 0.03938 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top