dear smartGWT community,
I would like to save a specific date+time within my domain object and provide detail view, grid view and input form (including date picker for the date), but I'm having difficulties to find a correct strategy to do that.
Sadly there is no DateTimeItem for DynamicForm nor ListGridFieldType.DATETIME for grid, which was my original thought.
Furthermore the various objects responsible for displaying date and time do not provide adequate formatting measures even when I manage to transport corresponding information from the domain object:
ListGridField.setTimeFormatter is not defined (but ListGridFieldType.TIME is defined!)
TimeItem.setTimeFormatter however is defined!
DetailViewerField.setType() has some completely different semantics from all above, so here I don't know anything, not even what I'm missing..
So my question is:
1) how should I represent datetime within domain object and corresponding datasource
2) how do I implement meaningful usable and consistently and well formatted input, grid display and detail view
3) is there a usable date api that could be run on client (because Calendar obviously cannot - maybe gwt has something, I'm a novice in both technologies, so sorry if I miss something..)
My unsuccessful strategies include:
1) mapping two fields (date and time) in form and grid into single domain object date property. The trouble is that to work effectively with dates (combine the two values) I cannot use java.util.calendar implementation because it cannot be compiled to JS.
2) using Strings to represent time and date (I wouldn't object to declaring a string based datetime and it would save me a lot of trouble :-)), but then I don't know how to correctly setup a mapping of string-value date into date form/detail/grid field including date picker etc..
3) using two date datasource fields one for time and one for date - then I'm struggling to achieve coherent formatting in various widgets - for ListGridField.setTimeFormatter method is not implemented, even though ListGridFieldType.TIME is! In detailviewer to be sure there is no way how to determine even the type of field. and obviously there's redundant information stored within my domain objects.
4) transforming the record some way before display and before submit to write the date/time formatting myself - here I don't know what methods to override or what handlers to add - and still I'd probably miss the date API..
maybe I'm doing something ultimately wrong or missing something trivial..
thank you very much for help, yours
-- peter
I would like to save a specific date+time within my domain object and provide detail view, grid view and input form (including date picker for the date), but I'm having difficulties to find a correct strategy to do that.
Sadly there is no DateTimeItem for DynamicForm nor ListGridFieldType.DATETIME for grid, which was my original thought.
Furthermore the various objects responsible for displaying date and time do not provide adequate formatting measures even when I manage to transport corresponding information from the domain object:
ListGridField.setTimeFormatter is not defined (but ListGridFieldType.TIME is defined!)
TimeItem.setTimeFormatter however is defined!
DetailViewerField.setType() has some completely different semantics from all above, so here I don't know anything, not even what I'm missing..
So my question is:
1) how should I represent datetime within domain object and corresponding datasource
2) how do I implement meaningful usable and consistently and well formatted input, grid display and detail view
3) is there a usable date api that could be run on client (because Calendar obviously cannot - maybe gwt has something, I'm a novice in both technologies, so sorry if I miss something..)
My unsuccessful strategies include:
1) mapping two fields (date and time) in form and grid into single domain object date property. The trouble is that to work effectively with dates (combine the two values) I cannot use java.util.calendar implementation because it cannot be compiled to JS.
2) using Strings to represent time and date (I wouldn't object to declaring a string based datetime and it would save me a lot of trouble :-)), but then I don't know how to correctly setup a mapping of string-value date into date form/detail/grid field including date picker etc..
3) using two date datasource fields one for time and one for date - then I'm struggling to achieve coherent formatting in various widgets - for ListGridField.setTimeFormatter method is not implemented, even though ListGridFieldType.TIME is! In detailviewer to be sure there is no way how to determine even the type of field. and obviously there's redundant information stored within my domain objects.
4) transforming the record some way before display and before submit to write the date/time formatting myself - here I don't know what methods to override or what handlers to add - and still I'd probably miss the date API..
maybe I'm doing something ultimately wrong or missing something trivial..
thank you very much for help, yours
-- peter