- Inspecting Oracle APEX Packaged Applications (Part 1)
- Inspecting Oracle APEX Packaged Applications (Part 3)
In this part we are going to implement a classic report using the cards template with a faceted search left side bar. In case you are wondering what a "faceted search" is, here is the definition according to Wikipedia:
Faceted search, also called faceted navigation or faceted browsing, is a technique for accessing information organized according to a faceted classification system, allowing users to explore a collection of information by applying multiple filters. A faceted classification system classifies each information element along multiple explicit dimensions, called facets, enabling the classifications to be accessed and ordered in multiple ways rather than in a single, pre-determined, taxonomic order.
Assuming we are working on Page Number 4.
- Modify the page properties:
- Page Template: Left Side Column
- Create a new region:
- Title: Cards
- Type: Classic Report
- SQL Query:
- Page Items to Submit: P4_SEARCH,P4_ORDER_BY,P4_CATEGORIES,P4_DISPLAY_AS
- Template: Blank with Attributes
- Static ID: cardsRegion
- Under the Report Attributes:
- Template: Cards
- Under Template Options:
- General: Apply Theme Colors
- Style: Basic
- Icons: Display Initials
- Create a new region:
- Title: Filter
- Position: Left Column
- Under Template Options:
- Header: Hidden
- Item Width: Stretch Form Fields
- Static ID: filterRegion
- Create a page item under the Filter region:
- Name: P4_SEARCH
- Type: Text Field
- Template: Hidden
- Under Template Options:
- Size: Large
- Icon CSS Classes: fa-search
- Value Placeholder: Search Movies
- Create another page item under the Filter region:
- Name: P4_ORDER_BY
- Type: Select List
- Label: Order By
- Template: Optional – Above
- List of Values Type: Static Values
- Static Values: STATIC2:Ascending;ASC,Descending;DESC
- Display Extra Values: No
- Null Display Value: - Select -
- Create another page item under the Filter region:
- Name: P4_CATEGORIES
- Type: Checkbox
- Template: Optional – Above
- List of Values Type: SQL Query
- SQL Query: select category d, id r from categories order by category asc
- Display Extra Values: No
- Display Null Value: No
- Pre Text:
- Create a region button under the Filter region:
- Button Name: RESET_FILTERS
- Label: Reset Filters
- Button Position: Below Region
- Button Template: Text with Icon
- Under Template Options:
- Type: Warning
- Width: Stretch
- Icon CSS Classes: fa-repeat
- Action: Defined by Dynamic Action
- Create a dynamic action:
- Name: Reset Search Filters
- Event: Click
- Selection Type: Button
- Button: RESET_FILTERS
- True Action #1:
- Action: Clear
- Selection Type: Item(s)
- Item(s): P4_SEARCH,P4_ORDER_BY,P4_CATEGORIES
- Create a dynamic action:
- Name: Refresh Report on Items Change
- Event: Change
- Selection Type: Item(s)
- Item(s): P4_ORDER_BY,P4_CATEGORIES
- True Action #1:
- Action: Refresh
- Selection Type: Region
- Region: Cards
- Create a dynamic action:
- Name: Refresh Report on Search Enter
- Event: Key Down
- Selection Type: Item(s)
- Item(s): P4_SEARCH
- Client-side Condition:
- Type: JavaScript expression
- JavaScript Expression: this.browserEvent.which === 13
- True Action #1:
- Action: Refresh
- Selection Type: Region
- Region: Cards
- True Action #2:
- Action: Cancel Event
- Event: Refresh Report on Search Enter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
null as card_link, | |
upper(decode(instr(m.name,' '),0,substr(m.name,1,2),substr(m.name,1,1)||substr(m.name,instr(m.name,' ')+1,1))) as card_initials, | |
m.name as card_title, | |
m.name as card_text, | |
listagg(c.category, ', ') within group (order by c.category) as card_subtext | |
from | |
movies m | |
left outer join movies_categories mc on m.id = mc.movie_id | |
left outer join categories c on mc.category_id = c.id | |
where | |
(:P4_SEARCH is null or | |
( | |
instr(upper(m.name),upper(:P4_SEARCH)) > 0 or | |
instr(upper(c.category),upper(:P4_SEARCH)) > 0 | |
)) and | |
(:P4_CATEGORIES is null or | |
instr(':'||:P4_CATEGORIES||':',c.id) > 0 | |
) and | |
nvl(:P4_DISPLAY_AS,'X') = 'CARDS' | |
group by | |
m.id, | |
m.name | |
order by | |
case when :P4_ORDER_BY = 'ASC' then lower(m.name) end asc, | |
case when :P4_ORDER_BY = 'DESC' then lower(m.name) end desc |
No comments:
Post a Comment