We recently upgraded to SmartGWT 4.0 from 3.4. Most things seem to work, but the relative date criteria don't seem to be converting to absolute dates in the datasource.
I've tried explicitly calling convertRelativeDates and setAutoConvertRelativeDates(doc says default is true) but the xhr shows that something like $today is being passed to the server. Here's some example code to demonstrate. I also ran this code under our old jar and it converted to an absolute date properly.
I've tried explicitly calling convertRelativeDates and setAutoConvertRelativeDates(doc says default is true) but the xhr shows that something like $today is being passed to the server. Here's some example code to demonstrate. I also ran this code under our old jar and it converted to an absolute date properly.
Code:
HLayout hlay = new HLayout(); final FilterBuilder filterBuilder = new FilterBuilder(); filterBuilder.setDataSource(new DataSource(){{ addField(new DataSourceDateTimeField("name", "label"){{ setValidOperators(OperatorId.GREATER_THAN, OperatorId.LESS_THAN, OperatorId.IS_NULL, OperatorId.NOT_NULL); }}); }}); hlay.addMember(filterBuilder); hlay.addMember(new Button("send"){{ addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { DataSource datasource = new DataSource("index.jsp"){{ setDataFormat(DSDataFormat.JSON); setAutoConvertRelativeDates(true); }}; AdvancedCriteria criteria = filterBuilder.getCriteria(true); datasource.fetchData(criteria, null); } }); }}); hlay.show();
Comment