On the way out: I notice that a ListGridField will automatically display in "MM/DD/YYYY " format (e.g., 04/07/2011) when reading the Oracle default date format of “DD-MMM-YY” (e.g., 07-APR-11).
On the way in: I need to pass a DateItem value as criteria for a fetch. Must I convert this explicitly via a custom method? Or does Smart GWT have something built-in for this?
Thanks!
The solution for me was the DateItem method getValueAsDate().
Truncated example code:
DateItem dateYouWantOff = new DateItem();
Date date = dateYouWantOff.getValueAsDate(); // "Conversion" I needed
Criteria checkExisting = new Criteria();
checkExisting.addCriteria("STARTDATE", date);
listGrid.fetchData(checkExisting);
My initial (incorrect) assumption was that I would need to reformat a date String and then pass that to my query.
But the simpler solution is to type-convert the DateItem value to a Date object, then pass that to my query.