Vaadin Touchkit dynamic favicon / touch-icon

Hey there,

I need to change the application icon of a vaadin touchkit application dynamically.
There are different projects stored in a database. Each project has its own application-icon stored as a base64 encoded image in the database. When the touchkit application loads an url-parameter sets the current project.
Now I need to set the application icon from the database.

Can someone please point it out for me?

Thanks in advance.

Hello,

You should be able to do that with TouchkitSettings.

       
TouchKitSettings s = getTouchKitSettings();
        s.getWebAppSettings().setWebAppCapable(true);

        String contextPath = getServletConfig().getServletContext()
                .getContextPath();

        s.getApplicationIcons().addApplicationIcon(
                contextPath + "VAADIN/themes/mytheme/icon.png");
        s.getWebAppSettings().setStartupImage(
                contextPath + "VAADIN/themes/mytheme/startup.png")

Sample is for static images, but Images/icons url could be some cached generated images, or a custom class generating image on-the-fly.

Regards
Sebastien