Smartclient power 8.2p
in a datasource I'm using an operation binding like this:
then, server side, I create a DsRequest on that datasource, and I noticed that getCriteria() doesn't return the criteria in the operationBinding.
Actually the docs says "A list of DSRequestModifiers that will be used to modify the criteria of each DSRequest that uses this operationBinding." so this seems correct.
Not handy though, because I'd like to add another criteria, to the criteria defined in the operation binding, to set it in the server side generated DsRequest.
I managed to do that this way:
is there a simpler/more correct approach?
in a datasource I'm using an operation binding like this:
Code:
<operationBindings> <operationBinding operationType="fetch"> <criteria fieldName="NOME_GRUPPO" value="whatever"> </criteria> </operationBinding> </operationBindings>
Actually the docs says "A list of DSRequestModifiers that will be used to modify the criteria of each DSRequest that uses this operationBinding." so this seems correct.
Not handy though, because I'd like to add another criteria, to the criteria defined in the operation binding, to set it in the server side generated DsRequest.
I managed to do that this way:
Code:
Criterion[] criterions = ...//another criteria DSRequest dsRequest = new DSRequest("GRUPPI", "fetch"); Map operationBinding = dsRequest.getDataSource().getOperationBinding("fetch"); Map dsRequestModifier = (Map) operationBinding.get("criteria"); SimpleCriterion operationBindingCriteria = new SimpleCriterion((String) dsRequestModifier.get("fieldName"), "equals", dsRequestModifier.get("value")); AdvancedCriteria advancedCriteria = new AdvancedCriteria(DefaultOperators.And, new Criterion[]{ new OrCriterion(criterions), operationBindingCriteria });
Comment