10.5.5 Editing a Faceted Search Page

Learn about how attributes can change faceted search page behavior.

Tip:

The examples in this topic are built on the EBA_PROJECT_TASKS table available in the sample dataset, Project Data. To install a sample dataset, see "Using Sample Datasets" in Oracle Application Express SQL Workshop Guide.

10.5.5.1 Viewing a Faceted Search Page in Page Designer

View a faceted search page in Page Designer.

To view a faceted search page in Page Designer:

  1. On the Workspace home page, click the App Builder icon.
  2. Select an application.
  3. Select the faceted search page.
    The page displays in Page Designer.

10.5.5.2 Understanding a Faceted Search Page

Learn about the regions that comprise a faceted search page.

About the Search Region

A faceted search page features a Search region which enables users to narrow down the search result and a Search Results region which displays as either a classic report or cards report.

The Search region displays in the left pane or Rendering tab. Selecting the Search region displays attributes in the Property Editor. In the following image, the Search region Type is defined as Faceted Search. The Filtered Region attribute identifies the Search Results region. In this example, Filtered Region is as a classic report named Search Results.

Tip:

Remember that each attribute in the Property Editor has associated Help. To view Help, select the attribute in the Property Editor and then click the Help tab in the central pane. Help describing the attribute appears in the central pane.

About Facets

Search facets display under Facets in the Rendering tab. When you select a facet, the associated attributes display in the Property Editor. Facets use the same naming convention as items. By default, wizards prefix facet names using the following convention: P<page no>_<item name>. For example, in the previous example, the first facet is named P2_SEARCH).

Facets are similar to items but feature the following unique characteristics:

  • Filtering on More Than One Column - The facet of type Search, generally called Search, can filter based on more than one column and, when not external always displays at the top of the facets region.

  • Associated with a Column - The facets are associated with a column from the report region.

  • Differences with Checkbox or Select List Facets - The facet types, such as Checkbox or Select List, indicate how UI enables the user to select or filter data. Facets are not implemented the same as page items even if they have a similar naming convention. For this reason, most dynamic actions do not apply to facets.

About the Search Results

A faceted search page includes a Search Results region which displays as either a classic report or cards report. In the following example, Search Results is a Classic Report built on the EBA_PROJECT_TASKS table.

About Cards Page Search Results

The Search Results in a faceted search page can display as a cards report. The SQL query for a cards page includes special aliases such as CARD_MODIFIERS and CARD_LINK. To link a card to a new page, you must update CARD_LINK in the underlying SQL query to point to the appropriate target. To see an example, see "Linking from a Cards Page."

10.5.5.3 Example: Editing Faceted Search Region Attributes

Edit region Attributes to change general search facet region behavior.

The following example demonstrates how the region attributes Batch Facet Changes and Show Total Row Count change the region behavior. Batch Facet Changes controls whether the report filtering executes as soon as a facet value changes, or individually by clicking an Apply button. Show Total Row Count determines if a row count value displays on the page. The following example is built on the EBA_PROJECT_TASKS table available in the sample dataset, Project Data.

To edit Search facet region Attributes:

  1. View the page in Page Designer.
  2. In Page Designer, select the Search region Attributes:
    1. In the Rendering tab (or left pane), locate the Search region.
    2. Under the Search region, select Attributes.

    The Attributes appear in the Property Editor located in the right pane.

    Description of edit_facet_attributes.png follows
    Description of the illustration edit_facet_attributes.png
  3. Enable Batch Facet Changes:

    This attribute controls how report filtering executes. When enabled and a user selects a facet, an Apply button appears under the facet. The user must click the Apply button to apply the facet and filter the report. When disabled, the report filtering executes as soon as the facet value changes.

    1. In the Property Editor, enable Batch Facet Changes.
    2. Click Save and Run Page.

      A rendered version of the application appears.

      Description of batch_facet_changes1.png follows
      Description of the illustration batch_facet_changes1.png
    3. In the Search region, select a project, such as Develop Production Partner Portal.
    4. Click Apply.

      A revised report appears and a filter displays above report.

    5. Return to Page Designer by clicking Edit Page 2 on the Runtime Developer Toolbar.
  4. Disable Show Total Row Count:
    1. In the Rendering tab, select Attributes if not already selected.
    2. In the Property Editor, set Show Total Row Count to No.
    3. Click Save and Run Page.

      Previously, when you ran the page, the total row count displays above the report as shown in the following illustration.

      Description of new_facet_old.png follows
      Description of the illustration new_facet_old.png

      With Show Total Row Count disabled, Total Row Count 17 no longer displays above the report as it did in the previous image.

10.5.5.4 Example: Editing Facet Attributes

Edit facet attributes to change facet behavior.

The following example demonstrates how to review a facet in Page Designer and edit the Client-Side Filtering and Depending On attributes and change facet behavior. Enabling Client-Side Filtering adds a search field which enables users to filter the facet list. Depending On makes the display of one facet dependent upon another. The following example is also built on the EBA_PROJECT_TASKS table available in the sample dataset, Project Data.

To edit facet attributes:

  1. View the page in Page Designer.
  2. Review the P2_PROJECT_ID facet:
    1. In the Rendering tab (or left pane) locate the Search region and select the facet, P2_PROJECT_ID.
    2. In the Property Editor (or right pane) find the List of Values group.

      The List of Values group indicates that the P2_PROJECT_ID facet is a List of Values created as a Shared Component.

    3. In the Property Editor, find the Source group.

      The Source group indicates that the P2_PROJECT_ID facet is based on the PROJECT_ID column which has a data type of Number.

  3. Add a Project filter to the Search region by enabling the Client-Side Filtering attribute:
    1. In the Rendering tab, select theP2_PROJECT_ID facet (if not already selected).
    2. In the Property Editor, find List Entries and enable Client-Side Filtering.
    3. Review your changes. Click Save and Run Page.

      The faceted search page appears and a new Filter Project field appears.

    4. Test the new Filter Project field. For example, entering the keyword "develop" will update the Project list to only include search facets containing that phrase.
    5. Click Edit Page 2 on the Runtime Developer Toolbar to return to Page Designer.
  4. Only show Milestones for the selected Project by enabling the Depending On attribute.
    1. In the Rendering tab locate the Search region and select the P2_MILESTONE_ID facet.
    2. In the Property Editor find Depending On and for Facet and select P2_PROJECT_ID.
    3. Review your changes. Click Save and Run Page.

      The faceted search page appears. Note that the Milestones list no longer displays.

    4. Select a project such as Develop Production Partner Portal.

      Note that the Milestones list now appears but only displays Milestones associated with the Develop Production Partner Portal project.

10.5.5.5 Example: Editing the Static List of Values for a Range Facet

Edit a range facet that displays as a static list of values.

The following example demonstrates how to edit a facet that renders as a static list of values. The following example is built on the COST column of the EBA_PROJECT_TASKS table available in the sample dataset, Project Data. This example demonstrates how to update the Cost list shown in the following illustration so that the first two rows display in increments of 500 instead of 300.

Description of cost_list.png follows
Description of the illustration cost_list.png

To edit a facet that displays as a static list of values:

  1. View the page in Page Designer.
  2. In the Rendering tab (or left pane) locate the Search region and select the facet, for example P2_COST.

    In the Property Editor (or right pane) note that the Type attribute indicates that P2_COST is defined as a Range.

    Description of cost_facet.png follows
    Description of the illustration cost_facet.png
  3. Edit the List of Values:
    1. Find the List of Values group.
    2. Click Static Values.
      Description of select_static_values.png follows
      Description of the illustration select_static_values.png

      The Static Values dialog appear.

      Description of static_values_dialog.png follows
      Description of the illustration static_values_dialog.png

      To avoid hard-coding a specific separator in the Display Value, the Static Values dialog uses substitution strings which are replaced with the appropriate NLS separator at runtime.

      In this example, the substitution string #G# is replaced with the NLS Group Separator, comma (,). Other lists can include a #D# substitution string which is replaced at runtime with the NLS Decimal Separator.

      Therefore, in this example 1#G#000 - 2#G#000 displays at runtime as 1,000 – 2,000.

    3. Update the Display Values and Return Values of the first two facets to use increments of 500:
      • Row 1:

        • Display Value - Update <300 to <500

        • Return Value - Update |300 to |500

      • Row 2:

        • Display Value - Update 300 - 1#G#000 to 500 - 1#G#000

        • Return Value: Update 300|1000 to 500|1000

      Description of static_values_dialog_new.png follows
      Description of the illustration static_values_dialog_new.png
    4. Click Ok to accept the changes.
  4. Review your changes. Click Save and Run Page.

    The revised facets search page displays. Note the first two facets in the Cost list display as <500 and 500 - 1,000.

    Description of cost_list_new.png follows
    Description of the illustration cost_list_new.png