3.5.2.1.48. 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
orderDcdata container forOrderentity, which hasdeliveryTimeattribute. ThedataContainerattribute of the time input component contains a link to the container, and thepropertyattribute – the name of the entity attribute displayed in the field.Related entity attribute should have
java.util.Dateorjava.sql.Timetype.
-
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
datatypeattribute.TimeFielduses the following data types:-
localTime -
offsetTime -
time
-
-
The time format is defined by the
timedatatype and is specified in the main localized messages pack in thetimeFormatkey. -
The time format can also be specified in the
timeFormatattribute. 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
showSecondsattribute. 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 - datatype - description - descriptionAsHtml - editable - enable - box.expandRatio - height - htmlSanitizerEnabled - icon - id - property - required - requiredMessage - showSeconds - stylename - tabIndex - timeFormat - visible - width
- Elements of timeField
- API
-
addValueChangeListener - commit - discard - isModified - setContextHelpIconClickHandler