Hi all,
I have build several xsp:pages which contain forms holding textboxes and
dropdownboxes. The dropdownboxes are filled with values from a query.
I will explain my problem with a real life example. The form offers a way
to search/filter for, let's say, trouble tickets. A trouble ticket is of a
certain type (incident, change or problem). It also has a severitycode (low,
middle, heavy) and it has a description for example.
Suppose I have a form with two dropdownboxes (ddb) and one textbox (tb)
*ddbType has following options : (SELECT DISTINCT TYPE FROM TROUBLES)
-- any type
incident
change
problem
*ddbSeverityCode has following options: (SELECT DISTINCT SEVERITYCODE FROM
TROUBLES)
-- any severity code
low
middle
heavy
*tbDescription (is empty)
Now i want depending of the userinput to run following query :
String MyDynamicQuery = "SELECT TROUBLEID FROM TROUBLES "
<!-- conditional If any parameters are filled in -->
+ " WHERE "
<!-- conditional if ddbType contains valid value (this means not empty
and not starts with '--' -->
TYPE = ?
<!-- conditional if ddbType contains valid value (this means not empty
and not starts with '--' -->
<!-- conditional if ddbSeverityCode contains valid value (this means
not empty and not starts with '--' -->
SEVERITYCODE = ?
<!-- conditional if ddbSeverityCode contains valid value (this means
not empty and not starts with '--' -->
<!-- conditional if tbDescription contains valid value (this means not
empty -->
DESCRIPTION LIKE %?%
<!-- conditional if tbDescription contains valid value (this means not
empty -->
<!-- conditional If any parameters are filled in -->
Is it possible to use woody and to use some binding mechanism to set the
parametrized WHERE statements in a clever way? Anyone working on something
similar?
Robby Pelssers
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]