Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem with AdvancedCriteria

    SmartGWT v3.0
    GWT v2.4

    Hello everybody:

    I have a problem when setting an AdvancedCriteria object and fetching data directly on a datasource by calling fetchData(criteria, callback) or filterData(criteria, callback).

    So I set the criteria as follows:

    Code:
    final AdvancedCriteria match_criteria = 
        new AdvancedCriteria(OperatorId.AND, 
    
           new Criterion[]{
               new Criterion("search_id", OperatorId.EQUALS ,selected_search_id),
               new Criterion("dynamic_rank", OperatorId.EQUALS , "true"),
               new Criterion("is_decoy", OperatorId.EQUALS , "false"),
               new Criterion("rejected", OperatorId.NOT_EQUAL, true),
               new AdvancedCriteria(OperatorId.OR, newCriterion[]{
                  new Criterion("validated", OperatorId.ICONTAINS , "A"),
                  new Criterion("validated", OperatorId.ICONTAINS , "B"),
                  new Criterion("validated", OperatorId.ICONTAINS , "C")
           })
    });
    Now anything that matches a boolean (e.g. the 'rejected' field) or an integer (e.g. search_id, Datasource type 'number') is correctly filtered/fetched. However, the specific criteria on the 'validated' field (which is a TEXT field in the datasource) is always ignored.

    When I connect the datasource to a ListGrid and use .setShowFilterEditor(true), filtering on the 'validated' field works fine.


    I don't understand why this doesn't work.

    Am I constructing the AdvancedCriteria incorrectly?
    Is there a bug?
    Is there anyway of getting the generated SQL from this criteria object?

    Any help appreciated.

    #2
    anyone have a similar issue?

    Comment

    Working...
    X