Smart GWT 3.1p v8.3p_2013-03-06/LGPL .
The following test case exposes two issues with the date range dialog used to filter date list grid fields:
The locale is forced to be de_CH in .gwt.xml!
Issue 1
The date selected through the date picker in the dialog is not recognized by Smart GWT. Upon validation I get "Must be a date." (validator_notADate message key). No date (format) settings were manipulated with DateUtil.
-> date-range-dialog.png
Issue 2
The error message '"To" field value cannot be earlier than "From" field value.' is not localized. DateRangeItem.setInvalidRangeErrorMessage(String) allows to modify this, the default is documented there, but there's no message key in com\smartgwt\client\i18n\SmartGwtMessages.properties. AFAIU there's no way I could call DateRangeItem.setInvalidRangeErrorMessage() in this case.
-> date-range-dialog-II.png
Sidenote
Running the test case in dev mode one gets the following message in console:
"[ERROR] [smartgwt] - 07:59:09.844:TMR0:WARN:StaticTextItem:isc_StaticTextItem_0[iconPlaceholder]:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element"
The following test case exposes two issues with the date range dialog used to filter date list grid fields:
Code:
public class SmartGwt implements EntryPoint { public void onModuleLoad() { VLayout canvas = new VLayout(); canvas.setMargin(20); ListGrid grid = new ListGrid(); grid.setShowFilterEditor(Boolean.TRUE); grid.setAutoFetchData(Boolean.TRUE); grid.setWidth(500); grid.setHeight(200); grid.setDataSource(DateRangeDialogDS.getInstance()); canvas.addMember(grid); canvas.draw(); } private static class DateRangeDialogDS extends DataSource { private static DateRangeDialogDS instance = null; public static DateRangeDialogDS getInstance() { if (instance == null) { instance = new DateRangeDialogDS("dateRangeDialogDS"); } return instance; } public DateRangeDialogDS(String id) { setID(id); setRecordXPath("/response/data/record"); DataSourceIntegerField pkField = new DataSourceIntegerField("id"); pkField.setHidden(Boolean.TRUE); pkField.setPrimaryKey(Boolean.TRUE); DataSourceDateField birthdateField = new DataSourceDateField("birthdate", "Birthdate"); DataSourceTextField nameField = new DataSourceTextField("name", "Name"); setFields(pkField, birthdateField, nameField); setDataURL("ds/daterangedialog.data.xml"); setClientOnly(Boolean.TRUE); } } }
Code:
<extend-property name="locale" values="de_CH"/> <set-property name="locale" value="de_CH" />
The date selected through the date picker in the dialog is not recognized by Smart GWT. Upon validation I get "Must be a date." (validator_notADate message key). No date (format) settings were manipulated with DateUtil.
-> date-range-dialog.png
Issue 2
The error message '"To" field value cannot be earlier than "From" field value.' is not localized. DateRangeItem.setInvalidRangeErrorMessage(String) allows to modify this, the default is documented there, but there's no message key in com\smartgwt\client\i18n\SmartGwtMessages.properties. AFAIU there's no way I could call DateRangeItem.setInvalidRangeErrorMessage() in this case.
-> date-range-dialog-II.png
Sidenote
Running the test case in dev mode one gets the following message in console:
"[ERROR] [smartgwt] - 07:59:09.844:TMR0:WARN:StaticTextItem:isc_StaticTextItem_0[iconPlaceholder]:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element"
Comment