SGWT: 4.1p.0.0
SC: v9.1p_2014-04-15
FF: 26
When a DateUtil.setShortDatetimeDisplayFormatter is specified the data submitted for the ListGrid criteria only contains the date not the time.
To reproduce:
Click on the filter for the date column.
Pick the start date using the calendar icon (If the drop down is used the correct value is submitted).
Pick the end date using the calendar icon.
Click OK.
Note that only the date part is submitted.
SC: v9.1p_2014-04-15
FF: 26
When a DateUtil.setShortDatetimeDisplayFormatter is specified the data submitted for the ListGrid criteria only contains the date not the time.
To reproduce:
Click on the filter for the date column.
Pick the start date using the calendar icon (If the drop down is used the correct value is submitted).
Pick the end date using the calendar icon.
Click OK.
Note that only the date part is submitted.
Code:
public class Main3 implements EntryPoint {
public static class RestDataSource extends com.smartgwt.client.data.RestDataSource{
public RestDataSource(final String fetchUrl, final String restUrl) {
setShowPrompt(false);
setDataFormat(DSDataFormat.JSON);
setDataProtocol(DSProtocol.POSTXML);
OperationBinding[] bindings = new OperationBinding[4];
if(fetchUrl != null){
bindings[0] = new OperationBinding(){{
setOperationType(DSOperationType.FETCH);
setDataURL(fetchUrl);
}};
}
if(restUrl != null){
bindings[1] = new OperationBinding(){{
setOperationType(DSOperationType.ADD);
setDataURL(restUrl);
}};
bindings[2] = new OperationBinding(){{
setOperationType(DSOperationType.UPDATE);
setDataURL(restUrl);
}};
bindings[3] = new OperationBinding(){{
setOperationType(DSOperationType.REMOVE);
setDataURL(restUrl);
}};
}
setOperationBindings(bindings);
}
}
@Override
public void onModuleLoad() {
// DateUtil.setShortDateDisplayFormatter(DateUtil.TOJAPANSHORTDATE);
DateUtil.setShortDatetimeDisplayFormatter(DateUtil.TOJAPANSHORTDATETIME);
new ListGrid(){{
setDataSource(new RestDataSource("app/items", "app/item"){{
setFields(new DataSourceIntegerField("id", "Id"){{setPrimaryKey(true);}},
new DataSourceDateTimeField("date", "Date"));
}});
setFetchDelay(400);
setHeight(200);
setHeight(400);
setShowFilterEditor(true);
setFilterOnKeypress(true);
setAutoFetchData(true);
}}.show();
}
}Code:
{
"dataSource" : "isc_Main3_1$1_0",
"operationType" : "fetch",
"startRow" : 0,
"endRow" : 75,
"textMatchStyle" : "substring",
"componentId" : "isc_Main3_1_0",
"data" : {
"operator" : "and",
"_constructor" : "AdvancedCriteria",
"criteria" : [ {
"_constructor" : "AdvancedCriteria",
"operator" : "and",
"criteria" : [ {
"fieldName" : "date",
"operator" : "greaterOrEqual",
"value" : "2014-05-01"
}, {
"fieldName" : "date",
"operator" : "lessOrEqual",
"value" : "2014-05-31"
} ]
} ]
},
"oldValues" : null
}