Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Arbitrary boolean condition in Hilite setCriteria

$
0
0
Hi Isomorphic,

I saw the example http://www.smartclient.com/smartgwt/...ng_pre_defined and wanted to ask if the following is possible:
Replace some of the conditions in
Code:

setCriteria(new AdvancedCriteria(OperatorId.AND, new Criterion[] { 
        new Criterion("gdp", OperatorId.GREATER_THAN, 1000000), 
        new Criterion("area", OperatorId.LESS_THAN, 500000)}));

with methods returning a boolean value. I have a method boolean User.mayEdit(Record r, ...) and would like to use it here.
Criterion does not have a constructor that takes a constant as 1st value, otherwise I could solve it using
Code:

...
new Criterion(true, OperatorId.EQUALS, User.mayEdit(Record r, ...))

Is there some workaround (other than defining a fake field always returning true in my .ds.xml) to do this?

Thank you & Best regards,
Blama

Viewing all articles
Browse latest Browse all 4756

Latest Images

Trending Articles



Latest Images