Hi,
I am evaluating the FilterBuilder. The idea was to save the criteria for later use. I found a few issues here in forum, some are a few years old. I think I did it right but when I print the criteria I only get one char, the "}". I have no idea why?
The filterbuilder looks like
and I try to get the criteria with a button.clickhandler:
The log only shows "}".....??? Any yes, I created a criteria in the GUI and fetched the ListGrid which works very well, so the criteria is there...
I am evaluating the FilterBuilder. The idea was to save the criteria for later use. I found a few issues here in forum, some are a few years old. I think I did it right but when I print the criteria I only get one char, the "}". I have no idea why?
The filterbuilder looks like
Code:
final FilterBuilder advancedFilter = new FilterBuilder();
advancedFilter.setDataSource(datasource);
advancedFilter.setID("filter");
advancedFilter.setShowFieldTitles(true);
advancedFilter.setShowModeSwitcher(true);
advancedFilter.setAllowEmpty(true);Code:
JSONEncoder encoder = new JSONEncoder();
encoder.setDateFormat(JSONDateFormat.DATE_CONSTRUCTOR);
String criteriaValue = JSON.encode(advancedFilter.getCriteria(true).getJsObj(), encoder);
GWT.log("A:"+criteriaValue);