Custom dynamic list??
I think this is similar to a common dilemma I've considered solving in the past. In that scenario, it almost sound like a custom dynamic list that's made to look like a breadcrumb might be more suitable.
Hunk09 wrote:First step is to create a hidden Px_PREV_PAGE item on the target page that can be set to the number you've come from. This can be used in conditions or queries to determine which breadcrumb/breadcrumb replacement is shown. Set the value of Px_PREV_PAGE using APP_PAGE_ID in links and branches to the target page.
I am using apex 4.1.1 linux 11gr2 firefox+chrome
I navigate to detail from a multiple source/drill down.
Can someone help me understand how i change breadcrumbs dynamically to state "where i am coming from"-->"current_page"
scott.wesley (grassroots-oracle.com) wrote:You'd need to make sure that you're not just moving the grunt work from maintaining static breadcrumb lists to maintaining the equivalent in hard-coded SQL. The way to go would be a hierarchical query that (re)creates the breadcrumb trail to the previous page (identified by Px_PREV_PAGE) from the APEX_APPLICATION_BREADCRUMBS and APEX_APPLICATION_BC_ENTRIES views, then add the target page as the last level. Something like:
Shared components -> Lists
Static or dynamic - dynamic lists are based on SQL and are my 3rd favourite thing in APEX
You can potentially write some hierarchical SQL (or just series of unions) that define the path you'd like to see as your "breadcrumb"
select row_number() over (order by lvl desc nulls last) list_level , label , target , is_current from (select /* Breadcrumb for previous page identified in item P6_PREV_PAGE */ level lvl , bce.entry_label label , bce.url target , null is_current from apex_application_breadcrumbs bc join apex_application_bc_entries bce on bc.breadcrumb_id = bce.breadcrumb_id where bc.application_id = :app_id and bc.breadcrumb_name = 'Main Menu' connect by prior bce.parent_breadcrumb_id = bce.breadcrumb_entry_id start with bce.defined_for_page = :p6_prev_page union all select /* Breadcrumb for current page */ null , bce.entry_label , bce.url , 'YES' from apex_application_breadcrumbs bc join apex_application_bc_entries bce on bc.breadcrumb_id = bce.breadcrumb_id where bc.application_id = :app_id and bc.breadcrumb_name = 'Main Menu' and bce.defined_for_page = :app_page_id) order by list_level
Then you define a list region on global page, conditionally displayed to suit your needs, and there could be a horizontal list template that suits your needs, or you adjust one to fit what you want - maybe even copying some of the breadcrumb template.You'd definitely want to create a custom list template to match the breadcrumb template to get a consistent L&F.
Giedrius S. wrote:I've thought about that approach quite a lot, but never took it any further than a quick experiment that pushed the page info onto a collection-based stack and displayed it via a pseudo-breadcrumb report (APEX 3.0, before dynamic lists). That's the easy part. After that come a number of issues that have to be handled:
In our project we used this solution:
* Every page contains before header process which inserts into apex_collection information about page being visited - page id, parameters
* Every page contains region, which generates breadcrumb based on information stored in apex_collection. It looks like the one APEX generates.
* When user navigates back, before header process removes N last entries, depending where user navigates - back one page (user presses cancel button) or back N pages (user presses dynamic breadcrumb entry)
This way user can navigate in application in any way, visit the same page few times, and everything is shown in dynamic breadcrumb. User can navigate back to any stage.
I've thought about that approach quite a lot, but never took it any further than a quick experiment that pushed the page info onto a collection-based stack and displayed it via a pseudo-breadcrumb report (APEX 3.0, before dynamic lists). That's the easy part. After that come a number of issues that have to be handled:If you navigate in any way other than "Cancel", pressing breadcrumb entries or visiting page via Main Menu (pressing menu item resets navigation history), system treats it as you are navigating deeper and new breadcrumb entry is created. Of course if needed you can have navigation resets on lists, like we have on main menu.
<li>Non-breadcrumb navigation: What happens if the user doesn't press Cancel buttons or breadcrumb entries, but navigates using tabs, nav bars, lists, or report links?
<li>Circular navigation: In the app I was working on at the time I experimented with this it was possible for users to navigate from a report to a detail page, then via lists and links through various related detail pages and end up back on the detail page, but looking at a different record to the one they started with. They can now start exploring the details related to that record...where does this end up?Everything is stored in breadcrumb history. User may see the same page few times in navigation history. As i said, apex collection stores visited pages and parameters which were used to open page, so we can open the same module with different data - depending which breadcrumb entry was pressed. If navigating history gets messy and user does not like it, user may go to starting point (pressing first entry in breadcrumb or using main menu) at any time.
<li>Display: Hiow many levels are displayed? What happens if the breadcrumb gets longer than one line?We are displaying unlimited entries, but if list gets longer than 6, every entry in a middle is displayed not by name but simply ".." so we get something like that Bla>Bla bla>Blabla ..> ..>..>Bla bla>Blabla>Bla bla. When you hover mouse over ".." it shows module name as hint.