Oracle Fusion Middleware Tag Reference for Oracle ADF Faces 12c (12.2.1.4.0) E81455-02 |
UIComponent class: oracle.adf.view.rich.component.rich.data.RichSearchSection
Component type: oracle.adf.RichSearchSection
The af:searchSection component represents a group of data to be used by the inputSearch component. There are primarily two kinds of searchSection
The default searchSection should provide a master list of data. Search section of any other type should provide a list that is subset of default searchSection.
Filtering of data is supported only on default searchSection.
In the UI, inputSearch component considers two types of view.
In the initial view, data from non-default searchSections and af:suggestionsSection is displayed. In the filtering view, only filtered data from default searchSection will be displayed. If af:suggestionsSection or a non-default searchSection is not provided, only in such a case is data from default searchSection is displayed in the initial view.
<af:inputSearch label="Label" valueAttribute="id"> <af:searchSection type="default" dataUrl="/rest/employees" /> </af:inputSearch>
Type | Phases | Description |
---|---|---|
org.apache.myfaces.trinidad.event.AttributeChangeEvent | Invoke Application, Apply Request Values |
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing. |
Name | Description |
---|---|
header | HTML template to be used as per section header. Mustache is the templating system supported by the component. In single selection mode, this facet is applicable only for non-default searchSection. In multi selection mode, the facet on default searchSection will serve the template for the selections list. |
Name | Type | Supports EL? | Description |
---|---|---|---|
attributeChangeListener | javax.el.MethodExpression | Only EL | a method reference to an attribute change listener. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing. |
binding | oracle.adf.view.rich.component.rich.data.RichSearchSection | Only EL | an EL reference that will store the component instance on a bean. This can be used to give programmatic access to a component from a backing bean, or to move creation of the component to a backing bean. |
dataUrl | String | Yes |
REST service endpoint URI that provides a list of suggestions for the search section.
This attribute supports these various types of URIs:
The REST response should strictly be in JSON format. The component will set the "Accept" header to "application/json" for the REST calls made. The JSON document should have a root property labeled "items" and its value should be an array. If "items" property isn't available, the first root property whose value is an array is chosen as the list of suggestions. Note: If the REST endpoint is on a different origin, CORS needs to be setup on the endpoint. |
filter | String | Yes |
This attribute holds the name of the JS callback that would perform Array.filter
operation on the default searchSection's collection returned from the REST response.
The suggestions filtered by the JS callback will be shown as a separate section
in the UI. Such a client filtered suggestion list is equivalent to a non default
url provided af:searchSection.
This attribute can't be set on the searchSection of type default
The component instance will be set as context during JS callback invocation.
The row object passed to the callback will have the structure below
{ 'EmpNo': 1234, 'Ename': 'Somename' } the object passed to this method will be of format { 'data': { 'EmpNo': 1234, 'Ename': 'Somename' }, 'index': 24, 'key': 1234 } Sample JS method: function smartListFiltering(rowObj, rowIndex) { return rowObj.data['isReportee'] == true; } |
filterParameters | String | Yes |
Attribute to set the query parameters on REST endpoint for
The REST call for fetching the desired resultset is attempted only if the master collection size is beyond the configured fetch limit set on the REST service and the REST response has "hasMore" property set. Otherwise the relevant filtering to obtain the desired resultset is completely done on the client and this attribute is not invoked. Note 1: Dependency based filtering should also happen on the server, and it will not be done on the client whenever server filtering is being attempted. Note 2: A converter needs to be attached to the inputSearch component to derive the display value from the displayAttributes when the master collection size is beyond the configured fetch limit. Note 3: Since searchSection of type default provides the master collection and since only this collection is filterable, this attribute is only applicable for default searchSection. This attribute holds the name of the JS callback. This JS callback is invoked when a REST call is being made
The searchSection client component instance will be set as context during JS callback invocation. A request and context objects will be passed as parameters to the function. The callback should return the configured passed in request object. The request object will have the structure below:
The context object will have the structure below:
function queryParamProvider(request, context) { if (context.criteria == AdfRichInputSearch.CRITERIA_VALUE_EQUALS) return selectedQueryParamProvider(request, context); request.queryString = "q="; for (each item in context.filterAttributes) for (each item in context.searchTerms) // append the relevant string to request['queryString']; return request; } function selectedQueryParamProvider(request, context) { var values = context.searchTerms; var valueAttribute = context.filterAttributes[0]; var q = "q="; for (var i = 0; i < values.length; i++) { if (i == 0) q += valueAttribute + "=" + values[i]; else q += " OR " + valueAttribute + "=" + values[i]; request.queryString = q; return request; } |
id | String | No |
the identifier for the component. Every component may be named by a component identifier that must conform to the following rules:
|
partialTriggers | String[] | Yes | the IDs of the components that should trigger a partial update. This component will listen on the trigger components. If one of the trigger components receives an event that will cause it to update in some way, this component will request to be updated too. Identifiers are relative to the source component (this component), and must account for NamingContainers. If your component is already inside of a naming container, you can use a single colon to start the search from the root of the page, or multiple colons to move up through the NamingContainers - "::" will pop out of the component's naming container (or itself if the component is a naming container) and begin the search from there, ":::" will pop out of two naming containers (including itself if the component is a naming container) and begin the search from there, etc. |
rendered | boolean | Yes |
Default Value: true whether the component is rendered. When set to false, no output will be delivered for this component (the component will not in any way be rendered, and cannot be made visible on the client). If you want to change a component's rendered attribute from false to true using PPR, set the partialTrigger attribute of its parent component so the parent refreshes and in turn will render this component. |
type | String | Yes |
Default Value: default The type of the search section. Broadly, there are two types of searchSection that are recognized by af:inputSearch component.
|