Hi,
We are long-time SmartGWT users and bumped into a nasty little problem.
SmartGWT version: SmartClient Version: SC_SNAPSHOT-2011-08-02/Pro Deployment (built 2011-08-02) (The latest 2.5 Pro build)
Browsers: Re-producable in all the browsers we've tested on: IE8-9, Chrome, Firefox.
We've got a ListGrid which lists invoices. The invoices are fetched based on the ListGrid's filters.
1. User enters the tab. The grid does not load data yet.
2. User clicks the Invoicing Date filter field. Date range picker dialog opens.
3. User picks a "from date" from the calendar component (2013-03-05) and exits the prompt by clicking OK.
4. User clicks the Entry Date filter field. Date range picker dialog opens.
5. User selects "from date" as Today from the Relative date combobox.
6. User selects "to date" as Tomorrow from the Relative date combobox.
7. User initiates fetch by clicking the filter button or by pressing Enter.
First request
Invalid set of invoices is returned.
User does not change any values in the filters and clicks the filter button.
Second request
The criteria is in a different form. This time it is in a form which our backend understands. The invoices are returned correctly.
Problem 1: Any ideas what might be causing this?
Problem 2: The weird values in the date fields are another problem (2013-04-05T20:59:59 and 2013-03-04T22:00:00). I bet they've got something to do with the values we set into the DateUtil.
Are we doing something wrong?
Thanks
We are long-time SmartGWT users and bumped into a nasty little problem.
SmartGWT version: SmartClient Version: SC_SNAPSHOT-2011-08-02/Pro Deployment (built 2011-08-02) (The latest 2.5 Pro build)
Browsers: Re-producable in all the browsers we've tested on: IE8-9, Chrome, Firefox.
We've got a ListGrid which lists invoices. The invoices are fetched based on the ListGrid's filters.
Code:
ListGrid invoiceGrid = new ListGrid(); invoiceGrid.setShowFilterEditor(true); invoiceGrid.setDataSource(LedgerInvoiceListRestDS.getInstance()); invoiceGrid.setAutoFetchData(false); invoiceGrid.setDataFetchMode(FetchMode.BASIC); ResultSet resultSet = new ResultSet(); resultSet.setUseClientFiltering(false); invoiceGrid.setDataProperties(resultSet); ListGridField entryDate = new ListGridField("entryDate", "Entry date"); entryDate.setFilterEditorType(new MiniDateRangeItem()); entryDate.setType(ListGridFieldType.DATE); ListGridField invoicingDate = new ListGridField("invoicingDate", "Invoicing date"); invoicingDate.setFilterEditorType(new MiniDateRangeItem()); invoicingDate.setType(ListGridFieldType.DATE); // And a bunch of other fields invoiceGrid.setFields(entryDate, invoicingDate);
2. User clicks the Invoicing Date filter field. Date range picker dialog opens.
3. User picks a "from date" from the calendar component (2013-03-05) and exits the prompt by clicking OK.
4. User clicks the Entry Date filter field. Date range picker dialog opens.
5. User selects "from date" as Today from the Relative date combobox.
6. User selects "to date" as Tomorrow from the Relative date combobox.
7. User initiates fetch by clicking the filter button or by pressing Enter.
First request
Code:
{ "dataSource":"ledgerInvoiceList", "operationType":"fetch", "componentId":"isc_MyListGrid_4", "data":{ "operator":"and", "criteria":[ { "operator":"and", "criteria":[ { "fieldName":"invoicingDate", "operator":"greaterOrEqual", "value":"2013-03-05" } ] }, { "operator":"and", "criteria":[ { "fieldName":"dueDate", "operator":"greaterOrEqual", "value":"2013-03-04T22:00:00" }, { "fieldName":"dueDate", "operator":"lessOrEqual", "value":"2013-04-05T20:59:59" } ] } ], "csrfToken":"BpNZxu6m1kC0lz7By3KgtQgk9E7owN4GvtOe4zVesAQ", "isc_metaDataPrefix":"_", "isc_dataFormat":"xml" }, "sortBy":[ "-invoiceNumber" ], "textMatchStyle":"substring", "resultSet":[ResultSet ID:isc_ResultSet_4 (created by: isc_MyListGrid_4)], "callback":{ "caller":[ResultSet ID:isc_ResultSet_4 (created by: isc_MyListGrid_4)], "methodName":"fetchRemoteDataReply" }, "willHandleError":true, "showPrompt":true, "prompt":"Haetaan tietoa...", "clientContext":{ "requestIndex":1 }, "requestId":"ledgerInvoiceList$62714" }
User does not change any values in the filters and clicks the filter button.
Second request
Code:
{ "dataSource":"ledgerInvoiceList", "operationType":"fetch", "componentId":"isc_MyListGrid_4", "data":{ "operator":"and", "criteria":[ { "fieldName":"invoicingDate", "operator":"greaterOrEqual", "value":"2013-03-05" }, { "fieldName":"dueDate", "operator":"greaterOrEqual", "value":"2013-03-04T22:00:00" }, { "fieldName":"dueDate", "operator":"lessOrEqual", "value":"2013-04-05T20:59:59" } ], "csrfToken":"BpNZxu6m1kC0lz7By3KgtQgk9E7owN4GvtOe4zVesAQ", "isc_metaDataPrefix":"_", "isc_dataFormat":"xml" }, "sortBy":[ "-invoiceNumber" ], "textMatchStyle":"substring", "resultSet":[ResultSet ID:isc_ResultSet_4 (created by: isc_MyListGrid_4)], "callback":{ "caller":[ResultSet ID:isc_ResultSet_4 (created by: isc_MyListGrid_4)], "methodName":"fetchRemoteDataReply" }, "willHandleError":true, "showPrompt":true, "prompt":"Haetaan tietoa...", "clientContext":{ "requestIndex":2 }, "requestId":"ledgerInvoiceList$62715" }
Problem 1: Any ideas what might be causing this?
Problem 2: The weird values in the date fields are another problem (2013-04-05T20:59:59 and 2013-03-04T22:00:00). I bet they've got something to do with the values we set into the DateUtil.
Code:
DateUtil.setShortDateDisplayFormatter(new FinnishDateFormat(true)); DateUtil.setNormalDateDisplayFormatter(new FinnishDateFormat(false)); DateUtil.setShortDatetimeDisplayFormatter(new FinnishDateFormat(false)); DateUtil.setDateInputFormatter(new FinnishDateFormat(false)); DateUtil.setDefaultDisplayTimezone("+02:00"); DateUtil.setAdjustForDST(true); // FinnishDateFormat is formatting with these formats: DateTimeFormat dtf = DateTimeFormat.getFormat("dd.MM.yyyy HH:mm:ss"); DateTimeFormat df = DateTimeFormat.getFormat("dd.MM.yyyy");
Thanks
Comment