Filtering by date or date range by using FilterCriteria on a Table
I am able to use the built-in feature of Table to filter the rows based on a text field (i.e display only those rows that has a certain value of a text field). Here is an example code:
CompareFilterCriteria criteria1 =new CompareFilterCriteria(new FieldKey("user_lname"),"Test ");
FilterCriteria fCreteria[] =new FilterCriteria[1];
fCreteria[0] = criteria1;
getTableRowGroup1().getTableDataFilter().setFilterCriteria(fCreteria);
This works. Now I need to figure out how to filter based on a date field. I want to be able to filter if date value is before/after a date or between a date range. I was wondering if I could use RegexFilterCriteria for this.
Any pointers, code, examples are highly appreciated. There is very little documentation on filtering in JSC.
Thanks
[970 byte] By [
Sabir] at [2007-11-26 9:47:25]

# 2
Thats my fall back in case if I can't use the built-in filtering. Table component has all the filtering built into it. I believe, this is faster too, as its cached vs. executing SQL every time user searches for some records.
Creator Team: I have noticed a lot of people using SQL when they could have used Filters -- because no one know how to use it. No documentation on it, except API doc, which is lacking in explanation.
When you have put all this hard work developing it, why not put a little more in documenting it with examples/codes/tutorials?
Message was edited by:
Sabir
Sabir at 2007-7-7 0:53:56 >

# 3
I don't believe this too faster, to use filtering api's or sorting api's with large tables all rows are fetched before being able to use the sorting facility, and only at this time the creator grid can sort the thousands of records brought back in its buffer, in the futures versions it is to better be able to program the click on the column header in the grid to modify the order by an reexecute the query. May be Filtering API's works with the same principle, in this case and with large tables it better to modify query and scroll its result.