The HtmlElement component

This component can display a single HTML element in the form, for example a header or an image.

Note that it is possible to add conditional contents with string interpolation.

The HtmlElement does not have a value and therefore it is not part of the submission data.

In addition to the properties and methods listed below, this component inherits properties and methods from the superclass Component. For example, any HtmlElement component has a label and hidden property even though these are not explicitly listed here.


tagThe HTML tag to use for this element.String'p'
classNameThe class name to provide to the HTML element.String
contentThe HTML content to place within the element.String
refreshOnChangeWhether or not to refresh the form when a change is detected.BooleanFalse
attrsArray of key-value pairs of attributes and their values to assign to the component. See the setAttrs method.Dict/Struct
tableViewWhen true and the component is part of an EditGrid, the component's value is shown (simplified) in the collapsed row of the EditGrid.BooleanFalse


setAttrsobj​.setAttrs(​attrs, values)Given an array of attribute names and their values, assign a valid dict/struct in the attrs property of the component.
setLocalImageobj​.setLocalImage(​imageFile, alt, options)Add content to an HtmlElement component for displaying a local image. Input imageFile is an absolute path. alt is an optional value that -when provided- sets the alt attribute of the img element. Use the ScaleToParentWidth name-value pair to have the component scale the image to match the width of the parent container.

See also

  • The 'Html' component allows for setting the HTML content through submission data.
  • The Content component allows for more elaborate HTML content to be added to the form.
  • The StatusIndicator uses an HtmlElement to display and update a status.
  • The How to for a piece of example code.