Monday, June 26, 2017

Display the correct dateformat in dateItem dynamicform smartgwt

I'm taking a record fron a grid to populate some item in a dynamicform. The problem is i cannot display dates in the right format for the form, it keeps displaying then as they are in the grid and whatever i do to format the date is just ignored by SmartGWT. I'm a bit confused. Below you'll find my code. Can anyone help me out?

dataTrade = new DateItem();
String dataT = movTitRecord.getAttribute(ListMovTitByValCodTitDetailDS.DATA_TRADE);
DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss.SSS");
Date dateTr = null;
= dateTimeFormat.parse(dataT);
} catch(IllegalArgumentException e){
.say("Couldn't parse date");
DateTimeFormat dateTimeFormat2 = DateTimeFormat.getFormat("dd/MM/yyyy");
String dateTra= dateTimeFormat2.format(dateTr);

To be more specific in debug the date is correctly formatted, when i pass the value to setDefaultValue it is dd/MM/yyyy as it should but when i load the page the format is still yyyy-MM-dd HH:mm:ss.SSS and i cannot understand why...

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment