Dynamic Where Sample
This sample illustrates the use of Dynamic Where to submit secure where clauses to the server in order to
filter records fecthed to the client. The sample provides a range of pre-defined Where clauses to choose from,
as well as a text field that allows the user to manually enter own where clause (in real life, Where clauses will of course
seldomly be hand-written in XML, but the appropriate APIs would be used to create the XML in code).
The grid at the bottom can be filled with the data fetched using the Where Clause.
Examine the code
-
Look at TClientForm.GetTemplateWhereExpression. This method uses the DynamicWhere API to create
different WhereExpression objects that encapsulate different data conditions.
- TClientForm.ShowXML method extracts the Xml representation of an existing WhereExpression object.
- Take a look at the TClientForm.btLoadClick event handler to see how conditions are applied and the resulting dataset is retrieved.
Getting started
- Run the Sample Server.
- Run the Dynamic Where Sample.
- Select one of the predefined conditions.
- Examine the XML corresponding to th choosen condition.
- Press the Load button tp load data.
- Try to change the XML, to validate changed XML and press the Load button again.
- Select the last condition (marked as wrong) and try to load data.