Hi All,
I have a FilterBuilder, ListGrid, RestDataSource and Button. I allow the user to build a query using the filter builder and then hit the button. The application then refreshes the grid with the new subset of records. This is done in the Button click handler as follows:
AdvancedCriteria criteria = filterBuilder.getCriteria();
grid.filterData(criteria);
I assume the grid makes a call to my server using the RestDataSource. The call contains the following get parameters:
_constructor = "AdvancedCriteria"
operator = "and"
criteria = "{fieldName:\"ev-severity\",operator:\"greaterThan\",value:\"0.3\"}"
_operationType = "fetch"
_startRow = "0"
_endRow = "50"
_textMatchStyle = "substring"
_componentId = "isc_OID_20"
_dataSource = "isc_OID_15"
Please note the criteria. If I try to parse this with my JSON parser on my server I get an error because it is not a proper JSON message. I think it should have been:
criteria = "{\"fieldName\":\"ev-severity\",\"operator\":\"greaterThan\",\"value\":\"0.3\"}"
I have added quotes around the name. Is criteria supposed to be in a JSON format? If it is, am I correct in my assumption that this is really not in a pure JSON format or is my JSON parser not flexible enough and it really should be able to parse it? Is there any way I can force SmartGWT or SmartClient to add the missing quotes?
As a work around I plan to put quotes around names before I pass it to my JSON parser.
Thanks,
Arend