Query by Example Version 2.0.0.0Print this Page
Table Filters Pattern Set
 
Description Return to Top

The Query By Example (QBE) pattern locates records that match specified criteria in a table.

  • The QBE bar appears directly above the table column or column group headers, one QBE field per column.
  • When the QBE bar is used in conjunction with a Search panel:
    • Criteria entered in the QBE fields is appended using the AND operator to criteria entered into the search fields.
    • The query is run when the user clicks the Search button in the search panel, selects the View, Refresh command, clicks the Search icon button on the table toolbar, or presses the Enter key while the focus is in one of the search fields.
For more information, see the Table Elements Usage Guideline.

Pattern Set Decision Table Return to Top
  Toolbar Filters QBE
Must the filter attribute always correspond to a table column? No Yes
Must the filter always be visible? Yes No
Is the user typically an expert? No Yes

Pattern Sample Return to Top
Query by Example

The QBE bar is hidden by default until the user selects View, Query by Example or clicks the Query by Example icon button on the toolbar. Product teams can choose to show the QBE bar by default when they expect the frequency of use to be high.

 
QBE
Figure 1. QBE bar and fields

Refreshing Table Data

Place a Search icon button on the table toolbar and a redundant Refresh command in the View menu.

There must be a visual affordance for rerunning the query that populates the table. Without it, users must discover that they can requery the table data by pressing the Enter key when a QBE field has the focus or by clicking the Search button in the query panel when one is present.

Removing Query by Example Criteria

QBE cells default to blank on page load. After entering filter critiera, users must manually clear each QBE field. You should provide a Clear button in the table toolbar to enable users to clear all QBE fields with a single click. You should also provide a redundant Clear Filters command in the View menu.

Refresh and Clear Fields commands
Figure 2. Search and Clear buttons on the toolbar and Refresh and Clear Filters commands in the View menu
QBE and Search

QBE can be enabled for a table with an associated search region. See the QBE Bar section and QBE Fields section of the Table Usage: Table Elements guideline.

Search criteria entered in QBE fields are ANDed with the search criteria. For example, a search criterion of Supplier="Oracle" plus a QBE criterion of Status="On Time" yields the query Supplier="Oracle" AND Status="On Time".

QBE cell values interact with search criteria as follows:

  • Editing search fields does not affect any QBE fields.
  • Editing QBE fields does not affect any search fields.
  • Saving the search saves all search criteria whether entered in search fields or QBE fields.
  • Selecting a saved search will populate search fields and QBE fields as they appeared when the search was saved.
QBE with Search Region
Figure 3. QBE fields on a search results table
Required Screen Elements
Component Type Required Components Customizable or Extendable Components
Table QBE Bar Can be disabled
Table QBE Field Can be disabled on a per column basis
Table Toolbar Query By Example button NA. Enabled whenever QBE bar is enabled
Table Toolbar View, Query By Example menu item NA. Enabled whenever QBE bar is enabled
Table Toolbar Search button NA
Table Toolbar View, Refresh menu item NA
Table Toolbar Clear button NA
Table Toolbar View, Clear Filters menu item NA
 
Related Patterns Return to Top
Transactional Search Pattern set used to select a user interface (UI) for search limited to one business object
Saved Searches Pattern set used to select different saved searches by using the View menu, tab equivalents, or a choice list.
 
Related Guidelines Return to Top
Search and Query Usage guideline Usage and behavior of ADF Query and Quick Query
Table Usage guidelines: Table Elements Detailed descriptions of the elements that can be used in each region of a table

 
About Oracle | Legal Notices | Terms of Use | Your Privacy Rights