Using format
| ID | Date | Money | |
|---|---|---|---|
| 51328 | email is clita-invidunt@nonumy.com | 15-04-2012 | 8,038.00 $ |
| 65754 | email is diam-et@sanctus.com | 24-06-2011 | 1,635.00 $ |
| 41116 | email is eos-erat@ea.com | 29-01-2012 | 6,044.00 $ |
| 76829 | email is eirmod-sanctus@amet.com | 17-06-2012 | 0,364.00 $ |
| 4219 | email is vero-kasd@consetetur.com | 13-06-2012 | 3,038.00 $ |
| 872 | email is labore-elitr@invidunt.com | 04-08-2012 | 2,514.00 $ |
| 34369 | email is duo-diam@sanctus.com | 04-03-2013 | 8,108.00 $ |
| 77992 | email is diam-sadipscing@sed.com | 18-06-2011 | 4,617.00 $ |
| 98402 | email is gubergren-nonumy@rebum.com | 15-10-2012 | 3,944.00 $ |
| 81506 | email is duo-dolor@diam.com | 04-10-2012 | 1,372.00 $ |
You can use any valid
java.text.MessageFormat
pattern in the
format
attribute. Sorting will be based on the original object, not on the formatted String.
Note that errors due to an invalid pattern/object combination (for example trying to format a String like a number) will not be rethrown. Instead, an error log will be written and the original unformatted object displayed.
You can also use a
format
pattern along with column decorators (the pattern will be applied after the decoration).
<display:table name="test">
<display:column property="id" title="ID" />
<display:column property="email" format="email is {0}" />
<display:column property="date" format="{0,date,dd-MM-yyyy}" sortable="true"/>
<display:column property="money" format="{0,number,0,000.00} $" sortable="true"/>
</display:table>