Dynamic Use / Download Themes
Dynamic Use / Download Themes
Not sure if this can be achieved but say I have say 5 styles defined for a web application where any particular user will only ever use 1 style, is it possible to dynamically use styles so that only one would get downloaded to the browser instead of all 5 which seems to be the case? It seems inefficient to have to download them all in this case.
-
René Houba
- Posts: 220
- Joined: Thu Nov 26, 2015 7:03 am
Re: Dynamic Use / Download Themes
Hi Mark,
Can you explain a little bit more...
So this is VL Web, because you use Themes.
You created 5 Themes that can be used in total.
How have you defined that one user for example is connected to one of these Themes?
Can you explain a little bit more...
So this is VL Web, because you use Themes.
You created 5 Themes that can be used in total.
How have you defined that one user for example is connected to one of these Themes?
Re: Dynamic Use / Download Themes
Mark/Rene,
in theory, you could use the following method (pass it the 9-character identifier of your theme) and it would only load when you call this method.
the downside to using this is: At Present time (Feb 2024) there is a bug meaning that this works the first call, but a subsequent call will crash your client (ie. the browser program). So if you are just wanting to set the users chosen theme (from 5 or more), then this should work.
It will fail if you wish to allow them to 'change themes' -- in this case you are better off defining the theme change in the usual manner:
As you noted, the second block downloads all the themes.
B.
in theory, you could use the following method (pass it the 9-character identifier of your theme) and it would only load when you call this method.
the downside to using this is: At Present time (Feb 2024) there is a bug meaning that this works the first call, but a subsequent call will crash your client (ie. the browser program). So if you are just wanting to set the users chosen theme (from 5 or more), then this should work.
Code: Select all
Mthroutine Name(ChangeTheme)
Define_Map For(*INPUT) Class(#Prim_alph) Name(#ThemeIdentifier)
Set_Ref Com(#SYS_WEB.WebPage.Theme) To(*CREATE_FROM #ThemeIdentifier)
Endroutine
Code: Select all
case of (#ThemeIdentifier)
when(= 1)
#SYS_WEB.WebPage.Theme <= #myTheme1
when= 2)
#SYS_WEB.WebPage.Theme <= #myTheme2
endcase
B.