| Query by Example | Version 2.0.0.0 |
||
|
|||
| Description | |
The Query By Example (QBE) pattern locates records that match specified criteria in a table.
|
| Pattern Set Decision Table |
| 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 |
| 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. |
![]() |
| 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. 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. |
![]() |
| 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:
|
![]() |
| Figure 3. QBE fields on a search results table |
| Related Patterns | |
| 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 | |
| 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 |