3.5.2.1.47. TimeField
TimeField
is a field for displaying and entering time.
XML-name of the component: timeField
.
-
To create a time field associated with data, dataContainer and property attributes should be used:
<data> <instance id="orderDc" class="com.company.sales.entity.Order" view="_local"> <loader/> </instance> </data> <layout> <timeField dataContainer="orderDc" property="deliveryTime"/> </layout>
As you can see in the example above, the screen defines the
orderDc
data container forOrder
entity, which hasdeliveryTime
attribute. ThedataContainer
attribute of the time input component contains a link to the container, and theproperty
attribute – the name of the entity attribute displayed in the field.Related entity attribute should have
java.util.Date
orjava.sql.Time
type.
-
If the field is not connected to an entity attribute (i.e. the data container and attribute name are not set), you can set the data type using the
datatype
attribute.TimeField
uses the following data types:-
localTime
-
offsetTime
-
time
-
-
The time format is defined by the
time
datatype and is specified in the main localized messages pack in thetimeFormat
key. -
The time format can also be specified in the
timeFormat
attribute. It can be either a format string, or a key in a message pack (with themsg://
prefix).
-
Regardless of the mentioned above format display of seconds can be controlled using
showSeconds
attribute. By default, seconds are displayed if the format containsss
.<timeField dataContainer="orderDc" property="createTs" showSeconds="true"/>
- Attributes of timeField
-
align - caption - captionAsHtml - contextHelpText - contextHelpTextHtmlEnabled - css - dataContainer - datasource - datatype - description - descriptionAsHtml - editable - enable - box.expandRatio - height - icon - id - property - required - requiredMessage - showSeconds - stylename - tabIndex - timeFormat - visible - width
- Elements of timeField
- API
-
addValueChangeListener - commit - discard - isModified - setContextHelpIconClickHandler