KUIML_WIDGET
Widget that can dynamically load KUIML code ("sub-skin") via a file or string. It can be used to load different content depending on the context, or load parts of a skin dynamically, only when required.
Warning: because all objects in KUIML may be stripped when not used by the skin, you need to make sure that the data accessed by the content of a sub-skin that is loaded at runtime will not be stripped, using for example the REQUIRED_OBJECTS element.
Attributes brief detailed show all inherited
Notes on using "sub-skins"
- Separate script space. Every subskin has its own scripting space. So if you have a function or an object/variable in the script of the main SKIN, it won't be available in the subskin. It also means that scripts in skin and subskin cannot communicate directly through script variables, only through the main skin's params and strings (exposed to both skin and sub-skin scripts).
- Subskin can import DEFINES, TEMPLATES, and VARIABLES that were defined in the parent skin before the KUIML_WIDGET element (by default it imports all of them, but you can disable importing of any type to speed up loading). VARIABLES set inside the main SKIN are accessible inside the subskin, though only those that were defined before that KUIML_WIDGET. Also if you change these VARIABLES inside "sub-skin" they won't update in the main SKIN (because the main skin is loaded and parsed before subskins).
- Subskins can communicate with the parent skin via params and strings defined in the main skin. Usually, these params should be explicitly mentioned in EXPOSED_OBJECTS (to be used in scripts) and REQUIRED_OBJECTS (to be not stripped and available inside the subskin).