9 Replies Latest reply: May 6, 2013 8:48 AM by Giedrius S. RSS

    breadcrumbs

    n_shah18
      Hi
      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"


      Thanks
        • 1. Re: breadcrumbs
          scott.wesley
          You could create some application items with timely computations to record the previous page number. That would be a start, hard to go further without more specific requirements.
          • 2. Re: breadcrumbs
            n_shah18
            Thank you scott for understanding and giving head start.

            The main purpose is to ease the navigation back.

            say my detail is 216

            I have a form user enter data-->> search result--> drill down to page 216

            I have another tab which is a grid layout ---> click on number -->>result--> drill down-->> 216

            i have other tabs and report too.. Maine idea to get to detail descriptive page 216 which provide more info.


            For example tracking shipment # , enter a company Id , generate a list tracking # , then click on # and go to drill down page which show detail from where it was initiated when delivered etc.

            I can navigated to detail page from multiple pages company profile , recent orders, outgoing/outstading orders
            If the breadcrumb is right then i can go back to right page where i came from.


            PS>This is just a conceptual idea that came into my mind to explain the scenario.



            Thanks
            • 3. Re: breadcrumbs
              scott.wesley
              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.
              • 4. Re: breadcrumbs
                n_shah18
                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.
                Custom dynamic list??
                I have no clue on that , infact never had to use one .
                Do have an example that you can share? if not , can you guide me further to experiment on this.
                • 5. Re: breadcrumbs
                  scott.wesley
                  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"

                  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.

                  Scott
                  • 6. Re: breadcrumbs
                    fac586
                    Hunk09 wrote:
                    Hi
                    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"
                    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.

                    For the breadcrumbs you've got 2 choices: actual APEX breadcrumbs or something else. To use APEX breadrumbs, you have to create a separate breadcrumb for each path to the target page, and a separate breadcrumb region for each breadcrumb. The regions should be conditional on the value of Px_PREV_PAGE.

                    This works, but it is rather tedious to set up, and is a pain to maintain, so the option of doing something else—like Scott's list idea—is worth considering. However make sure that it is a better option than just getting on with creating the basic multi-breadcrumb one...
                    scott.wesley (grassroots-oracle.com) wrote:
                    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"
                    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:
                    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.

                    Edited by: fac586 on 02-May-2013 10:08

                    Added sample dynamic list query. Wish I'd thought of this years ago when I actually needed it...
                    • 7. Re: breadcrumbs
                      Giedrius S.
                      Hello,

                      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.


                      Giedrius
                      • 8. Re: breadcrumbs
                        fac586
                        Giedrius S. wrote:

                        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:

                        <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?
                        <li>Display: Hiow many levels are displayed? What happens if the breadcrumb gets longer than one line?

                        Are these issues in your project? How does your solution handle them?

                        Is this a generic solution that can easily be applied to any app, or is it application-specific or dependent on a specific approach to navigation?
                         
                        -----

                        More generally: What are breadcrumbs for? How useful they? My opinion is that there are 2 different use cases:

                        <li>"You are here": Complex apps with a deep fixed structure where the current context is not fully indicated by visible navigation elements (tabs, lists etc).
                        <li>"This is how you got here": Apps with multiple/dynamic routes to the same point (whether physically like the OP in this thread, or logically by calling the same page with data from different levels of a tree or nodes of a graph).

                        In the case of apps with a structure only 2 or 3 levels deep&mdash;where the current context is clear from visible navigation elements&mdash;are breadcrumbs necessary? Are they just used out of habit?
                        • 9. Re: breadcrumbs
                          Giedrius S.
                          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:

                          <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?
                          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>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.

                          The only problem with this solution we encountered is when user navigates back using browsers "Back" button. Navigation history does not get updated this way, but user may expect that it would.


                          Giedrius