The Label component ( ) displays read-only text of arbitrary length.
To define how the label content is rendered, call the setContentMode() method with the ContentMode enumeration literal. The literal can be set to:
Important: When using the HTML content mode make sure no injection and XSS vulnerabilities can be exploited.
def Label l := new Label();
l.setBinding(new ClosureBinding({->"The current <b>time</b> is " + now()}));
l.setContentMode(ContentMode.Html);
l.setCaption("Clock");
l;
Note: When defining closure binding in the Properties view, define only the body of the closure as the property value.