5.2.2.3.3. Example of Data Formatting in UI
Let’s consider how the Order.date
attribute is displayed in orders table.
order-browse.xml
<table id="ordersTable">
<columns>
<column id="date"/>
<!--...-->
The date
attribute in the Order
class is defined using "date" type:
@Column(name = "DATE_", nullable = false)
@Temporal(TemporalType.DATE)
private Date date;
If the current user is logged in with the Russian locale, the following string is retrieved from the main message pack:
dateFormat=dd.MM.yyyy
As a result, date "2012-08-06" is converted into the string "06.08.2012" which is displayed in the table cell.