Skip to Content
author's profile photo Former Member
Former Member

Changing the application theme dynamically

Hi All,

Is there any way to change the Analysis Application theme dynamically. We would like to use the same application for Mobile and Desktop users with the different themes. There are two challenges doing this in Scripts,

1. To know the access mode of the application (Mobile or Desktop)

2. Set the proper theme for respective access mode.

Any possible way !!!

Thanks,

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 02, 2014 at 10:15 AM

    Hi Anil,

    You could use 1 custom css file containing all your custom "theme-css-properties" for all your devices (mobile & desktop).

    If you have 1 theme (css code) for desktop users and 1 theme (css code) for mobile users, you would include all of these css selectors/properties into one css file. The differentiation between desktop and mobile devices can be done with media queries.

    Some useful sites regarding media queries:

    Media Queries for Standard Devices | CSS-Tricks

    Media Query Snippets - list of media queries

    A similar question has been asked in the following discussion: Responsive design

    Regards,

    David

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 27, 2013 at 06:16 AM

    Hi Anil,

    As of now, there is no way to know what the access mode to the application is. Also, there is no way to dynamically change the theme per se. However, dynamically changing the way components look CAN be achieved by using CSS classes and modifying the classes at runtime using "setCSSClass" for the components. Although the workaround is tedious, a functionality close to what you were asking can be achieved in this manner.

    Regards,

    Eshwar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Eshwar,

      As you agree, changing the class of the individual components is cumbersome. We even don't have the possibility of changing the Custom CSS dynamically else it could have been easier.

      As regards point 1, I can just think of a workaround using the Global Variables (which can be passed as URL) and providing different URL link (with variable passed as "Desktop") of the same application to Desktop users.

      But the second challenge still remains.

      Lets keep trying.

      Regards,

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.