Hi,
In the following example there is the RestDataSource with Date (not DateTime) field attached to the FilterBuilder and the ListGrid.
When entering greater_or_equal criteria the FilterBuilder generates this fine request:
Hoowever, when the same criteria is entered into the ListGrid filter row, then ListGrid generates this request:
This time the Date serialization is different/wrong as it contains time information (GMT):
<value>2010-11-15T23:00:00</value>
The test case:
SmartGWT nightly build 2010-11-15 (and previous versions).
Could this be corrected in the future releases ?
Thanks,
MichalG
In the following example there is the RestDataSource with Date (not DateTime) field attached to the FilterBuilder and the ListGrid.
When entering greater_or_equal criteria the FilterBuilder generates this fine request:
Code:
<request> <data> <isc_RestDataSource_0 constructor="AdvancedCriteria"> <operator>and</operator> <criteria> <fieldName>independence</fieldName> <operator>greaterOrEqual</operator> <value>2010-11-16</value> </criteria> </isc_RestDataSource_0> </data> <dataSource>isc_RestDataSource_0</dataSource> <operationType>fetch</operationType> <startRow>0</startRow> <endRow>75</endRow> <textMatchStyle>substring</textMatchStyle> <componentId>isc_ListGrid_0</componentId> <oldValues></oldValues> </request>
Code:
<request> <data> <isc_RestDataSource_0 constructor="AdvancedCriteria"> <operator>and</operator> <criteria> <_constructor>AdvancedCriteria</_constructor> <operator>and</operator> <criteria> <elem> <fieldName>independence</fieldName> <operator>greaterOrEqual</operator> <value>2010-11-15T23:00:00</value> </elem> </criteria> </criteria> </isc_RestDataSource_0> </data> <dataSource>isc_RestDataSource_0</dataSource> <operationType>fetch</operationType> <startRow>0</startRow> <endRow>75</endRow> <textMatchStyle>substring</textMatchStyle> <componentId>isc_ListGrid_0</componentId> <oldValues></oldValues> </request>
<value>2010-11-15T23:00:00</value>
The test case:
Code:
package org.yournamehere.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.OperationBinding; import com.smartgwt.client.data.RestDataSource; import com.smartgwt.client.data.fields.DataSourceDateField; import com.smartgwt.client.types.DSDataFormat; import com.smartgwt.client.types.DSOperationType; import com.smartgwt.client.types.DSProtocol; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.FilterBuilder; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.layout.VLayout; public class MainEntryPoint implements EntryPoint { public MainEntryPoint() { SC.showConsole(); } public void onModuleLoad() { RestDataSource ds = new RestDataSource(); ds.setDataFormat(DSDataFormat.XML); ds.setDataURL("/umowyserwis/UmowyRest"); OperationBinding fetch = new OperationBinding(); fetch.setOperationType(DSOperationType.FETCH); fetch.setDataProtocol(DSProtocol.POSTMESSAGE); ds.setOperationBindings(fetch); DataSourceDateField independenceField = new DataSourceDateField("independence"); ds.setFields(independenceField); final FilterBuilder filter = new FilterBuilder(); filter.setDataSource(ds); final ListGrid grid = new ListGrid(); grid.setShowFilterEditor(true); grid.setDataSource(ds); final IButton filterButton = new IButton("Search"); filterButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { try { grid.filterData(filter.getCriteria()); } catch (Exception e) { GWT.log(e.getLocalizedMessage(), e); e.printStackTrace(); } } }); VLayout main = new VLayout(); main.addMember(filter); main.addMember(filterButton); main.addMember(grid); main.draw(); } }
Could this be corrected in the future releases ?
Thanks,
MichalG
Comment