Hello,
I am using smartGwt 2.5 (according to the jar) which I downloaded from the nightlies on 8th Feb.
I have been trying to combine two advancedCriteria but seem to be having problems.
I have two criteria, criteriaOne and criteriaTwo as follows...
I would like to combine the two with an OR operator.
I have tried to do this
but this changes the AND operator in criteriaOne to be OR so this does not have the desired effect.
I have tried this
but this returns the criteria with an AND operator.
I have also tried this
but this returns null.
Could you please tell me how I can combine the two criterias with an OR operator? I appreciate that I could do it manually but I have more complex criterias to combine and would like to use the methods provided.
Many Thanks
Jeni
I am using smartGwt 2.5 (according to the jar) which I downloaded from the nightlies on 8th Feb.
I have been trying to combine two advancedCriteria but seem to be having problems.
I have two criteria, criteriaOne and criteriaTwo as follows...
Code:
AdvancedCriteria criteriaOne = new AdvancedCriteria(OperatorId.OR, new Criterion[] {
new Criterion("status", OperatorId.EQUALS, 2),
new Criterion("status", OperatorId.EQUALS, 3)});
criteriaOne.addCriteria(new AdvancedCriteria("incInVat", OperatorId.EQUALS, 1));
AdvancedCriteria criteriaTwo = new AdvancedCriteria(OperatorId.OR, new Criterion[] {
new Criterion("status", OperatorId.EQUALS, 2),
new Criterion("status", OperatorId.EQUALS, 3)});
criteriaTwo.addCriteria("paidVat", OperatorId.NOT_EQUAL, 1);
I have tried to do this
Code:
criteria = new AdvancedCriteria(criteriaOne);
criteria.addCriteria(criteriaTwo);
criteria.setOperator(OperatorId.OR);
I have tried this
Code:
criteria = new AdvancedCriteria(DataSource.combineCriteria(criteriaOne,
criteriaTwo).getJsObj());
I have also tried this
Code:
criteria = (AdvancedCriteria)DataSource.combineCriteria(criteriaOne,
criteriaTwo,
CriteriaCombineOperator.OR,
TextMatchStyle.SUBSTRING);
Could you please tell me how I can combine the two criterias with an OR operator? I appreciate that I could do it manually but I have more complex criterias to combine and would like to use the methods provided.
Many Thanks
Jeni
Comment