zorba-the-geek / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

AdvancedCriteria missing #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the only way to use AdvancedCriteria is by a FilterBuilder. The
AdvancedCriteria class itself is only a JSO wrapper without the
AdvancedCriteria specific methods. For data sources it would be important
to build advanced criteria in code (without a visible widget).

What version of the product are you using? On what operating system?
Revision 249 on WinXP

Please provide any additional information below.
see http://forums.smartclient.com/showthread.php?t=3731

Original issue reported on code.google.com by dev...@gmail.com on 20 Jan 2009 at 7:22

GoogleCodeExporter commented 9 years ago

Original comment by sanjiv.j...@gmail.com on 17 May 2009 at 2:33

GoogleCodeExporter commented 9 years ago
Constructors have been added to allow creation of AdvancedCriteria from code. 
See sample usage here : 
http://code.google.com/p/smartgwt/source/browse/trunk/samples/showcase/src/com/s
martgwt/sample/sh
owcase/client/grid/sortfilter/GridBigFilterSample.java

FilterBuilder filterBuilder = new FilterBuilder();

AdvancedCriteria criteria = new AdvancedCriteria(OperatorId.AND, new 
AdvancedCriteria[] {
        new AdvancedCriteria("field2", OperatorId.ISTARTS_WITH, "C"),
        new AdvancedCriteria(OperatorId.OR, new AdvancedCriteria[] {
            new AdvancedCriteria("field73", OperatorId.NOT_EQUAL_FIELD, "field191"),
            new AdvancedCriteria("field130", OperatorId.ICONTAINS, "B")
        })
});

filterBuilder.setCriteria(criteria);

There is room for improvement in the API and this will be done in a future 
release.

Original comment by sanjiv.j...@gmail.com on 26 Feb 2010 at 1:13