Prompting for retrieval criteria

You can define your DataWindow object so that it always prompts for retrieval criteria just before it retrieves data. PocketBuilder allows you to prompt for criteria when retrieving data for a DataWindow control, but not for a DataStore object.

StepsTo prompt for retrieval criteria in a DataWindow object:

  1. If the Column Specifications view is not already displayed, select View>Column Specifications from the menu bar.

    In the default layout for the DataWindow painter, the Column Specifications view displays in a stacked pane under the Properties view. All columns defined for the DataWindow object are listed in the view.

  2. Select the Prompt check box next to each column for which you want to specify retrieval criteria at runtime.

    After you select the Prompt check box, PocketBuilder will display the Specify Retrieval dialog box just before a retrieval is to be done (it is the last thing that happens before the SQLPreview event).

    Each column you selected in the Column Specification view displays in the grid. Users can specify criteria here exactly as in the grid in the Quick Select dialog box. Criteria specified are added to the WHERE clause for the SQL SELECT statement defined for the DataWindow object.

NoteTesting in PocketBuilder You can test whether the application containing the DataWindow object will prompt for retrieval criteria by retrieving data in the Preview view of the DataWindow object.

Using edit styles

If a column uses a code table or the RadioButton, CheckBox, or DropDownListBox edit style, an arrow displays in the column header and users can select a value from a drop-down list when specifying criteria.

The sample shows the Specify Retrieval Criteria dialog box that a user sees just before a retrieval is done. The  column is dept _ i d and under it is the Criteria field showing the value 100 with an arrow to its right for a drop down list of department names. The R and D department is selected in the drop down list. This corresponds to the value of 100 for the department I D.

If you do not want the drop-down list used for a column for specifying retrieval criteria, select the Override Edit check box on the General page of the column's Properties view.

Forcing the entry of criteria

If you have specified that a column should prompt for criteria, you can force the entry of criteria for the column by selecting the Equality Required check box on the General page of the column's Properties view. PocketBuilder underlines the column header in the grid during prompting. Selection criteria for the specified column must be entered, and the = operator must be used.

For more information

The section “Using Quick Select” describes in detail how you can specify selection criteria in the grid.

The chapter on dynamic DataWindow objects in the Resource Guide describes how to write scripts to dynamically allow users to specify retrieval criteria during execution.