How to change theme

Hi,
we need to change theme (color scheme) when we are changing from one application window/view to another. I have tried both application.setTheme() and application.getMainWindow().setTheme() but css won’t be changed before I press refresh in browser. Is there some way to force hole page refresh or is there some other way to do this?

  • markus

Which version of the IT Mill Toolkit are you using? I believe this kind of theme changing should be possible with the latest version.

See also a previous discussion on the same issue:
http://forum.itmill.com/posts/list/448.page

We are using 5.2.6_trunk_20080701. This was the one where MenuBar component was inside. I tried to upgrade to newest 5.3.0 one from trunk but it broked couple of things like MenuBars. I don’t want to make needed changes before 5.3.0 is ready so that I don’t have to make those changes again, but it’s good that this seems to be fixed in latest version.

  • markus

[quote=Markus]
We are using 5.2.6_trunk_20080701. This was the one where MenuBar component was inside. I tried to upgrade to newest 5.3.0 one from trunk but it broked couple of things like MenuBars. I don’t want to make needed changes before 5.3.0 is ready so that I don’t have to make those changes again, but it’s good that this seems to be fixed in latest version.
[/quote]I could suggest you upgrade to 5.2.10, the latest stable release currently. It includes several important bugfixes after 5.2.6, and should be fully compatible with 5.2.6. You should be able to just replace the JAR with the newer, and be done with it :slight_smile:

Just in case you still need to refresh the whole page sometime: you can use window.open() to open a new url - opening the application url (using an ExternalResource), should cause the whole page to be refreshed.

Best Regards,
Marc

I believe there is no com.itmill.toolkit.ui.MenuBar component in 5.2.10. That’s why we are so desperately waiting for 5.3.0 RC.

  • markus

[quote=Markus]
I believe there is no com.itmill.toolkit.ui.MenuBar component in 5.2.10. That’s why we are so desperately waiting for 5.3.0 RC.

  • markus
    [/quote]Oh, shoot, my bad. You’re right, MenuBar component is still only in trunk.

[quote=Jouni Koivuviita]
You’re right, MenuBar component is still only in trunk.
[/quote]It might be possible to backport MenuBar from trunk to 5.2 branch. Would that be a good solution for you, Markus, or are guys waiting for some other improvements that are only coming to 5.3?

[quote]
It might be possible to backport MenuBar from trunk to 5.2 branch. Would that be a good solution for you, Markus, or are guys waiting for some other improvements that are only coming to 5.3?
[/quote]I think that we don’t need any other new component from 5.3 than MenuBar so it would be great solution but I haven’t got time to try it.

  • markus