How to Add the quickQuery Component Using a Model

12-14 Web User Interface Developers Guide for Oracle Application Development Framework

12.4 Using the query Component

The query component is used for full feature searches. It has a basic and an advanced mode, which the user can toggle between by clicking a button. The features for a basic mode query include: ■ Dropdown list of selectable search criteria operators ■ Selectable WHERE clause conjunction of either AND or OR match all or match any ■ Saved seeded searches ■ Personalized saved searches The advanced mode query form also includes the ability for the user to dynamically add search criteria by selecting from a list of searchable attributes. The user can subsequently delete any criteria that were added. The user can select from the dropdown list of operators to create a query for the search. The input fields may be configured to be list-of-values LOV, number spinners, date choosers, or other input components. To support selecting multiple items from a list, the model must expose a control hint on viewCriteriaItem and the underlying attribute must be defined as an LOV in the corresponding view object. The hint is used to enable or disable the multiple selection or in operator functionality. When multiple selection is enabled, selecting the Equals or Does not equal operator will render the search criteria field as a selectManyChoice component. The user can choose multiple items from the list. The component for the search criteria field depends on the underlying attribute data type, the operator that was chosen, and whether multiple selection is enabled. For example, a search field for an attribute of type String with the Contains operator chosen would be rendered as an inputText component, as shown in Table 12–3 . If the operator is Equals or Does not equal, but multiple selection is not enabled, the component defaults to the component specified in the Default List Type hint from the model. If the underlying attribute is the Number data type, the component that will be rendered is shown in Table 12–4 . Table 12–3 Rendered Component for Search Criteria Field of Type String Operator Component Component When Multiple Select Is Enabled Starts with af:inputText af:inputText Ends with af:inputText af:inputText Equals Default list type hint af:selectManyChoice Does not equal Default list type hint af:selectManyChoice Contains af:inputText af:inputText Does not contain af:inputText af:inputText Is blank None None Is not blank None None Using Query Components 12-15 If the underlying attribute is the Date data type, the component that will be rendered is shown in Table 12–5 . If a search criterions underlying attribute was defined as an LOV, in order for the auto-complete feature to work, the ListOfValues model instance returned by the getModelList method of the AttributeCriterion class must return true for its isAutoCompleteEnabled method. For more information about LOV, see Chapter 11, Using List-of-Values Components. When autoSubmit is set to true, any value change on the search criterion will be immediately pushed to the model. The query component will automatically flush its criterion list only when it has dependent criteria. If the criterion instance has no Table 12–4 Rendered Component for Search Criteria Field of Type Number Operator Component Component When Multiple Select Is Enabled Equals Default list type hint af:selectManyChoice Does not equal Default list type hint af:selectManyChoice Less than af:inputNumberSpinBox af:inputNumberSpinBox Less than or equal to af:inputNumberSpinBox af:inputNumberSpinBox Greater than af:inputNumberSpinBox af:inputNumberSpinBox Greater than or equal to af:inputNumberSpinBox af:inputNumberSpinBox Between af:inputNumberSpinBox af:inputNumberSpinBox Not between af:inputNumberSpinBox af:inputNumberSpinBox Is blank None None Is not blank None None Table 12–5 Rendered Component for Search Criteria Field of Type Date Operator Component Component When Multiple Select Is Enabled Equals Default list type hint af:selectManyChoice Does not equal Default list type hint af:selectManyChoice Before af:inputDate af:inputDate After af:inputDate af:inputDate On or before af:inputDate af:inputDate On or after af:inputDate af:inputDate Between af:inputDate 2 af:inputDate 2 Not between af:inputDate 2 af:inputDate 2 Is blank None None Is not blank None None