|
|
How to format a date/time in a ROO list view table?
In my list view of an entity I have a modified date with the @DateTimeFormat(style=quot;MSquot;) annotation. ROO picks up this format for the view page but the list display is not using the format information.
How and where can I set date formatting for date/time/datetime data in ROO table views, either individually per entity field or globally for the application?
Does anyone have an answer for this?
I have the same issue with boolean fields of an entity. While the create and update forms display the dojo decorated checkbox, the show page and list view displays 'true' or 'false', which is not very user friendly either. I would prefer the checkbox images, some other use cases might want to display yes/no, on/off etc.
On the show page I could solve it by creating and using a custom checkbox display tag but in case of the lists I have not found a nice solution yet. The column.tagx does not display the column but only sets some parameters in the request scope. One thought I had was to add a parameter like 'type' and depending on the type adjust the display in the table.tagx.
Solved it now by extending the column and table tags with column type information and adjusting the display based on the type.
Am still wondering if there is a nicer or better solution?
This may help: browse/ROO-1861
Originally Posted by mikejThis may help: browse/ROO-1861
yes, that's the same issue and delivers a solution for the date column. Setting maxLength to a negative number avoids the problem described in ROO-1861 and in case of a formatted date field it doesn't make sense to use maxLength anyhow:Code:
lt;table:column id=quot;c_com_mydomain_myEntity_modifieddatequot; maxLength=quot;-1quot; property=quot;modifiedDatequot; render=quot;truequot; z=quot;user-managedquot;/gt;
In this case it uses the pattern from the entity field annotation. If you want to specify the date format in the list table for a certain page only, my workaround would work. |
|