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.

Syntax

&Number = SetTheme("ObjectName")

Where:

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

Type returned:
Numeric(1)

Scope

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

Description

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.

Samples

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

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

Availability

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

See Also

GetTheme function