Skip to Content
avatar image
Former Member

Change theme inside a component [or alternative way]

Hello again,

i am looking for a solution to change the theme used by a component within the component itself.

I do not mean the application or URL parameters (WDTHEMEROOT or sap-ep-themeroot).

We are running the WD-Component w/o Portal. The User opens a browser, calls the WD-Application and logs on. Now, before the first view is visible for the user, i want to change the Theme depending on the users name ( e.g. read from a z-table). Did anyone find a way to do that ?

From my sight an alternative to have such a functionality would be to have a "pre" component that is called by the user. That component builds the URL with the according theme-parameter and calls the next component by URL. But, i do not want to have another Browser-Window and i do not know, how to call the application by URL in the same window.

Any suggestions ?

Thanks a lot !

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jun 17, 2010 at 08:35 AM

    The way the WD Framework functions, you would not be able to change the theme once the component is running. The intialization of the theme and the sending of the corresponding MIMEs would already have taken place.

    Your idea of a loader of some sort would be your only only option I think. I would actually suggest going with a nice lightweight stateless BSP for this loader since it only needs to build a URL string. However if you want to use WD as the loader, you can certainly do so. You can navigate in place by firing an exit plug. I don't know if you can fire an exit plug during WDDOINIT. You might need some event to trigger before the exit plug (like a 1 second timed trigger).

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Thomas,

      we tried it out and found a working solution with a "loader" WD component !

      Create a new component with one window, one view

      Create an Outbound plug 'TO_WINDOW' for the view with parameter 'URL'

      Create an Inbound plug 'FROM_VIEW' for the window with parameter 'URL'

      Create a navigation link in the window from 'TO_WINDOW' to 'FROM_VIEW'

      Create an Exit plug 'TO_URL' in the window with parameters

      URL TYPE STRING

      CLOSE_WINDOW TYPE WDY_BOOLEAN

      In WDDOINIT of the View build the URL as needed, then fire outbound plug

      In Handler method 'HANDLEFRON_VIEW' fire the exit plug with parameters URL and CLOSE_WINDOW (has to be space in our case)

      Kind regards

      Andreas