SetTheme function for Web

Official Content
This documentation is valid for:

Changes the current application Web Theme (or Design System) for any other Web Theme (or Design System) at runtime. The change must be made for the same type of object.


&Number = SetTheme("ObjectName")


    Name of the Web Theme object or Design System object to change.

Type returned:


Objects: Web PanelTransactionProcedureData ProviderPanel
Generators: .NET,.NET Framework,Java


This function changes the application Web Theme (or Design System) for another WebTheme (or Design System) at runtime.
The change must be made for the same type of object.
The function returns 1 when the object could be changed. Otherwise, it returns 0. 
If the object can't be changed, the current object remains as if the function was not executed. 
Once the SetTheme function has been successful, the Web Theme setting remains active for the rest of the session. In Web applications, it means that GeneXus code automatically saves the value of the current Web Theme in the current session.


Event &MyTheme.Click
    If SetTheme(&MyTheme)<>0
Event 'Orange'
    &NumVar = SetTheme(!'Orange')   // Set the web page with the Orange theme inmediately.

Take into account the "!" symbol before the theme name for translation purposes. (For further information, see GeneXus Application Localization).


Design System Objects are supported by this function since GeneXus 17 Upgrade 6.

See Also

GetTheme function
SetLanguage function