div

div wraps related components together, so they can be easily styled. If there are no nested components and styles, it represents nothing — the user will see an empty space.

  • XML element: div

  • Java class: Div

Basics

The following example shows div that applies a standard theme to its nested component:

<div themeNames="success">
    <p text="This paragraph has green text and a light green background."/>
</div>
div basic

Attributes

themeNames

Adds a theme to the component. Possible values are:

  • normal

  • success

  • error

  • contrast

  • primary

  • small

  • pill

whiteSpace

MDN

Defines the component’s white-space style value. Possible values are:

  • NORMAL

  • NOWRAP

  • PRE

  • PRE_WRAP

  • PRE_LINE

  • BREAK_SPACES

  • INHERIT

  • INITIAL

Handlers

Чтобы сгенерировать заглушку обработчика в Jmix Studio, используйте вкладку Handlers панели инспектора Jmix UI, или команду Generate Handler, доступную на верхней панели контроллера экрана и через меню CodeGenerate (Alt+Insert / Cmd+N).

ClickEvent

com.vaadin.flow.component.ClickEvent is sent when the user clicks on the component.