XML Descriptors
A screen descriptor is an XML file containing the declarative definition of visual components, data components, and some screen parameters.
Use Studio screen designer to set up your XML descriptor. |
For example, look at the XML descriptor of the edit screen:
<window xmlns="http://jmix.io/schema/ui/window"
focusComponent="demoForm"
caption="msg://window.caption">
<data>
<instance id="orderDc"
class="ui.ex1.entity.Order">
<fetchPlan extends="_base"/>
<loader/>
</instance>
</data>
<facets>
<dataLoadCoordinator auto="true"/>
<screenSettings id="settingsFacet" auto="true"/>
</facets>
<actions>
<action id="windowCommitAndClose" caption="msg:///actions.Ok"
icon="EDITOR_OK"
primary="true"
shortcut="${COMMIT_SHORTCUT}"/>
<action id="windowClose"
caption="msg:///actions.Close"
icon="EDITOR_CANCEL"/>
</actions>
<dialogMode height="600"
width="800"/>
<layout spacing="true" expand="editActions">
<form id="demoForm" dataContainer="orderDc">
<column width="350px">
<timeField id="deliveryTimeField" property="deliveryTime"/>
<textField id="ratingField" property="rating"/>
<dateField id="dateField" property="date"/>
<textField id="amountField" property="amount"/>
</column>
</form>
<hbox id="editActions" spacing="true">
<button id="commitAndCloseBtn" action="windowCommitAndClose"/>
<button id="closeBtn" action="windowClose"/>
</hbox>
</layout>
</window>
The window
element is a root element that has the following attributes:
-
messagesGroup
- an arbitrary message group associated with this window. If themessagesGroup
attribute is not defined messages are loaded from the package, associated with this screen class. -
caption
- a window caption that can contain a link to a message from the messages group mentioned above. -
description
- additional information about the window that can contain a link to a message from the messages group mentioned above. -
icon
- a window icon. -
extend
is used for extending UI. -
focusComponent
- an identifier of a component that should get input focus when the screen is displayed.
Elements of the descriptor:
-
data
- defines data components of the screen. -
facets
- defines the list of facets for the screen. -
actions
- defines the list of actions for the screen. -
dialogMode
- defines settings of geometry and behavior of the screen when it is opened as a dialog.Attributes of the
dialogMode
element:-
closeable
- defines whether the dialog window has a close button. Possible values:true
,false
. -
closeOnClickOutside
- defines if the dialog window should be closed by clicking outside the window area when the window has a modal mode. Possible values:true
,false
. -
forceDialog
- specifies that the screen should always be opened as a dialog. Possible values:true
,false
. -
height
- sets the height of the dialog window. -
modal
- specifies the modal mode for the dialog window. Possible values:true
,false
. -
positionX
- sets the x position of the top-left corner of the dialog window. -
positionY
- sets the y position of the top-left corner of the dialog window. -
resizable
- defines whether a user can change the size of the dialog window. Possible values:true
,false
. -
width
- sets the width of the dialog window.<dialogMode height="600" width="800" positionX="200" positionY="200" forceDialog="true" resizable="true"/>
-
-
layout
- a root element of the screen layout.