It defines a set of custom attributes. Custom attributes are objects associated with a particular scope. Acceptable scopes include component, space, page, desktop, session and application.
As depicted below, custom-attributes is convenient to assign custom attributes without programming.
<window> <custom-attributes main.rich="simple" very-simple="intuitive"/> </window>
It is equivalent to
<window> <zscript> self.setAttribute("main.rich", "simple"); self.setAttribute("very-simple", "intuitive"); </zscript> </window>
Moreover, you could specify what scope to assign the custom attributes to.
<window id="main" title="Welcome"> <custom-attributes scope="desktop" shared="${main.title}"/> </window>
It is equivalent to
<window id="main"> <zscript> desktop.setAttribute("shared", main.title); </zscript> </window>
Notice that EL expression is evaluated against the component being created. Sometime it is subtle to notice. For example, ${componentScope.simple} is evaluated to null, in the following codes. Why? It is a shortcut of <label value="${componentScope.simple}"/>. In other words, the component, self, is the label rather than the window, when the EL is evaluated.
<window> <custom-attributes simple="intuitive"/> ${componentScope.simple} </window>
is equivalent to
<window> <custom-attributes simple="intuitive"/> <label value="${componentScope.simple}"/><!-- self is label not window --> </window>
Tip: Don't confuse <attribute> with <custom-attributes>. They are irrelevant. The attribute element is a way to define a XML attribute of the enclosing element, while the custom-attributes element is used to assign custom attributes to particular scopes.