Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartGWT and DateItem serialization

    When I worked with GWT/GWT-Ext one of the subtle problems I had was when I was working with Dates and having to serialize them.

    Essentially, if I was purely only interested in the day, month and year of a Date (eg, birthdays), the serialization process may cause a bug because in GWT java.util.Date is serialized by calling getTime(). If the client and server are in different timezones, when the Date is rebuilt at the server, the day may have gone forward or back a day (or not at all depending on the circumstances).

    More discussion is here: http://groups.google.com/group/google-web-toolkit/browse_thread/thread/fd7b80de11507908/

    In my project I ended up implementing a SimpleDate class, which wrapped 3 integers for day, month and year. The server side converted this into a Date accordingly.

    I don't have a remotely good enough understanding of the innards of SmartGWT to know if it will have this problem. How does the serialization of a DateItem occur when working with DataSources?

    fyi, this came up to me again in SmartGWT as there is a complex DynamicForm in my current project where it was simpler for me to implement executeAdd by using plain GWT-RPCs rather than via the GwtRpcDataSource, and on this form one of the fields is a DateItem.

    #2
    See this overview of date and time storage and transmission.

    Comment

    Working...
    X