Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

FilterBuilder criteria shows always "}"

$
0
0
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
Code:

        final FilterBuilder advancedFilter = new FilterBuilder();
        advancedFilter.setDataSource(datasource);
        advancedFilter.setID("filter");
        advancedFilter.setShowFieldTitles(true);
        advancedFilter.setShowModeSwitcher(true);
        advancedFilter.setAllowEmpty(true);

and I try to get the criteria with a button.clickhandler:
Code:

JSONEncoder encoder = new JSONEncoder();
encoder.setDateFormat(JSONDateFormat.DATE_CONSTRUCTOR);
String criteriaValue = JSON.encode(advancedFilter.getCriteria(true).getJsObj(), encoder);
GWT.log("A:"+criteriaValue);

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...

Viewing all articles
Browse latest Browse all 4756

Trending Articles