Actions Example 9: Dialog for Search Conditions

Previous Next

See Also

This example shows how you can build a Search Dialog that allows the user to enter a date value and a number of days. If the user clicks the Search button, the dialog disappears and a Search Results info window is opened that displays all the tours scheduled on the date entered, or days after that up to the number of days entered:

For example, if the user types start date: 01-JAN-2001, and Range: 100, the Search Results info window displays all tours starting between January 1, 2001 and 100 days later.

Here are the two GUI classes you need to create:

· A new Search Results info window. You can define a subclass of the Scheduled Tours info window that performs a query on startup with the query conditions passed to it by the dialog. You will have to create two new string properties to catch those values.

 

· A new Search Dialog dialog box with a DATE field, a NUMBER field and a Search button. The Search action consists of opening the Search Results info window and passing the DATE and the NUMBER value as parameters.

You will have to use the standard USoft date format and database specific functions to transfer DATE values safely.

NOTE:

The reason why you can use simple string values here is that the search dialog closes when the OK button is clicked. The Search Results window does not refer back to the dialog. This contrasts with examples 11 and 12, where object-like (as opposed to string-like) properties are required.

Continue with Search Results Window.

Related Topics

Search Results Window

Search by Start Date Dialog