TimeField
Basics
To create a TimeField
associated with data, you should use the dataContainer
and property
attributes:
@JmixEntity
@Table(name = "UIEX1_ORDER")
@Entity(name = "uiex1_Order")
public class Order {
@JmixGeneratedValue
@Column(name = "ID", nullable = false)
@Id
private UUID id;
@Column(name = "DELIVERY_TIME")
@Temporal(TemporalType.TIME)
private Date deliveryTime;
}
<data>
<instance id="orderDc"
class="ui.ex1.entity.Order">
<fetchPlan extends="_base"/>
<loader/>
</instance>
</data>
<layout>
<timeField dataContainer="orderDc"
property="deliveryTime"
caption="Delivery time"/>
</layout>
In the example above, the screen has the orderDc
data container for the Order
entity, which has the deliveryTime
property. The reference to the data container is specified in the dataContainer attribute. The name of the entity attribute which value should be displayed in the field, is set in the property attribute.
Related entity attribute should have java.util.Date
, java.time.LocalTime
or java.time.OffsetTime
type.
Time Format
-
You can define the time format by the time datatype and specify it in the localized messages pack in the
timeFormat
key. -
You can also set the time format in the
timeFormat
attribute:<timeField timeFormat="mm/HH"/>
Attributes
Events and Handlers
To generate a handler stub in Jmix Studio, select the component in the screen descriptor XML or in the Jmix UI hierarchy panel and use the Handlers tab of the Jmix UI inspector panel. Alternatively, you can use the Generate Handler button in the top panel of the screen controller. |
Validator
See Validator.
ValueChangeEvent
See ValueChangeEvent.
TimeField XML Attributes
You can view and edit attributes applicable to the component using the Jmix UI inspector panel of the Studio’s Screen Designer. |
align - box.expandRatio - buffered - caption - captionAsHtml - colspan - contextHelpText - contextHelpTextHtmlEnabled - css - dataContainer - datatype - description - descriptionAsHtml - editable - enable - height - htmlSanitizerEnabled - icon - id - property - required - requiredMessage - resolution - responsive - rowspan - stylename - tabIndex - timeFormat - timeMode - visible - width