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

  • FilterBuilder Issue

    I would like to use FilterBuilder , I will use it to build custom criteria to apply it to filter Listgrid data, I also have a TreeGrid of Filters when user click on TreeNode a FilterBuilder in dialog will appear with initial criteria regard to the selected filter by setting criteria to FilterBuilder myFilterBuilder.setCriteria(criteria);

    But i have an issue when i use
    AdvancedCriteria criteria = new AdvancedCriteria("jobName",OperatorId.CONTAINS,"OurJobName");

    i will have this error And the first selestItem will be Contains And middle selectioitem will be empty !!!

    [ERROR] Found top-level AdvancedCriteria with no sub-criteria. Converting to a top-level 'and' with a single sub-criterion

    but when i use

    AdvancedCriteria criteria= new AdvancedCriteria(OperatorId.AND,
    new Criterion[]{new Criterion("jobName",OperatorId.CONTAINS,"OurJobName" )});

    I dont have error ??? but the middle selectItem Will be Empty !!!

    what should i do to use the same as the first one ???

    Any Help Please ?

  • #2
    For any one else have the same problem

    I notice that you should add parent operator to the criteria to work fine
    just like this
    new AdvancedCriteria(OperatorId.AND,new Criterion[]{.............}

    And for the empty select item i resolve that by add setValidOperators to datasource fields like this