Hello Isomorphic,
I have a problem in passing the criteria value to ds.xml. Please find the
details below:
SmartGWT Power 2.4 - (SC_SNAPSHOT-2011-01-05/PowerEdition Deployment 2011-01-05)
Browser: Any
snippet from ds.xml:
<operationBinding
operationType = "fetch"
<tableClause> T_APP_MOD_MASTER </tableClause>
<whereClause><![CDATA[
...
T_APP_MOD_MASTER.APP_ID(+) = $criteria.APP_ID AND
T_APP_MOD_MASTER.MOD_ID(+) = $criteria.MOD_ID AND
($defaultWhereClause)
]]>
</whereClause>
</operationBinding>
DataSource appModMasterDS = DataSource.get("T_APP_MODULE_MASTER");
AdvancedCriteria ac1 = new AdvancedCriteria("APP_ID", OperatorId.EQUALS, "1");
AdvancedCriteria ac2 = new AdvancedCriteria("MOD_ID", OperatorId.EQUALS, "9");
AdvancedCriteria acArray[] = {ac1, ac2};
AdvancedCriteria c1 = new AdvancedCriteria(OperatorId.AND, acArray);
AdvancedCriteria c2 = getAdditionalCriteria();
AdvancedCriteria cArray[] = {c1, c2};
AdvancedCriteria appModCriteria = new AdvancedCriteria(OperatorId.AND, cArray);
appModMasterDS.fetchData(appModCriteria, new DSCallback() {
...
});
The values from the criteria are not replaced when the sql query is generated resulting in error.
If I use a normal Criteria instead of AdvancedCriteria, the values from the criteria are replaced in the generated query and things work fine. Unfortunately, I have to use AdvancedCriteria due to other requirements.
I also tried using $criteria.criteria[1].APP_ID as was suggested in a similar post. In the case also, the resultant query was messed up (the whole criteria object string was replaced like for $criteria) as like:
T_APP_MOD_MASTER.APP_ID(+) = '[{operator=and, criteria=[{fieldName=APP_ID, operator=equals, value=1}...]}]'[1].APP_ID and
...
How do I form the whereClause in ds.xml so that I can use the values from
the AdvancedCriteria correctly?
Is there any other method that I can use? Can I pass the values through
the DSRequest? How can I access the DSRequest attributes in the ds.xml?
Thanks,
Mouli
I have a problem in passing the criteria value to ds.xml. Please find the
details below:
SmartGWT Power 2.4 - (SC_SNAPSHOT-2011-01-05/PowerEdition Deployment 2011-01-05)
Browser: Any
snippet from ds.xml:
<operationBinding
operationType = "fetch"
<tableClause> T_APP_MOD_MASTER </tableClause>
<whereClause><![CDATA[
...
T_APP_MOD_MASTER.APP_ID(+) = $criteria.APP_ID AND
T_APP_MOD_MASTER.MOD_ID(+) = $criteria.MOD_ID AND
($defaultWhereClause)
]]>
</whereClause>
</operationBinding>
DataSource appModMasterDS = DataSource.get("T_APP_MODULE_MASTER");
AdvancedCriteria ac1 = new AdvancedCriteria("APP_ID", OperatorId.EQUALS, "1");
AdvancedCriteria ac2 = new AdvancedCriteria("MOD_ID", OperatorId.EQUALS, "9");
AdvancedCriteria acArray[] = {ac1, ac2};
AdvancedCriteria c1 = new AdvancedCriteria(OperatorId.AND, acArray);
AdvancedCriteria c2 = getAdditionalCriteria();
AdvancedCriteria cArray[] = {c1, c2};
AdvancedCriteria appModCriteria = new AdvancedCriteria(OperatorId.AND, cArray);
appModMasterDS.fetchData(appModCriteria, new DSCallback() {
...
});
The values from the criteria are not replaced when the sql query is generated resulting in error.
If I use a normal Criteria instead of AdvancedCriteria, the values from the criteria are replaced in the generated query and things work fine. Unfortunately, I have to use AdvancedCriteria due to other requirements.
I also tried using $criteria.criteria[1].APP_ID as was suggested in a similar post. In the case also, the resultant query was messed up (the whole criteria object string was replaced like for $criteria) as like:
T_APP_MOD_MASTER.APP_ID(+) = '[{operator=and, criteria=[{fieldName=APP_ID, operator=equals, value=1}...]}]'[1].APP_ID and
...
How do I form the whereClause in ds.xml so that I can use the values from
the AdvancedCriteria correctly?
Is there any other method that I can use? Can I pass the values through
the DSRequest? How can I access the DSRequest attributes in the ds.xml?
Thanks,
Mouli
Comment