I got a question during the training how to create a dynamic breadbrumb. If you don't know what a breadcrumb is, it looks like this:
Breadcrumbs are nice to have a hierarchical navigation view or a visual flow how you came to that page. In Oracle Application Express breadcrumbs are rather static. You specify for which page the breadcrumb counts and if it has a parent. It's not "out-of-the-box" to make it more dynamic, so I made a quick example to show how you can create a dynamic breadcrumb.
In my example you've three different pages. The request was if you go to page 3, it should know from which page you came, so you can click the breadcrumb to go back to the page you came from. In my case Page 1 or Page 2.
You can use different breadcrumbs which you show based on a condition, but that's not really dynamic. So let's try to make it more dynamic!
Create 3 pages and call them: Master 1, Master 2 and Child
On the Master Pages add a Submit button to the Child Page. Also add a breadcrumb on all pages like you normally would do.
Do you see you have a problem? For the Child breadcrumb you need to specify a master, but you've two masters! So how to get around this?
Create two Application Items: AI_PARENT_PAGE, AI_PARENT_PAGE_NAME
(in the screenshot I've one more, but in this example you don't need it)
On the Master Pages, in the Branch for the Submit button, specify that it need to go to Page 3 and give the Application Items the value of the master page you're on. On the screenshot in my case Page 1 (Master 1).
Page 2 would be the same expect from the last line where you would have 2, Master 2.
In the breadbrumb you would reference the Application Items instead of the fixed page number and page name. Change the original breadcrumb for Master 1 to:
The result will be a dynamic breadcrumb!
You can download the example application which shows the feature
here.
I thought it might be useful for others too, hope it helps some of you.