LSPS documentation logo
LSPS Documentation
Label

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:

  • HTML renders HTML code
  • preformatted preserves newlines
  • or plain text.

Important: When using the HTML content mode make sure no injection and XSS vulnerabilities can be exploited.

LabelForm.png
Form with a Label
LabelRendered.png
Form with Labels above rendered
Expression that returns a Label

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.

closureBinding.png