Why you should create a separate breadcrumb item in ORACLE APEX?

What I’m going to do is I’m going to add a little process at the beginning of my page and I’m just going to say p3 depth know so don’t worry too much about what’s happening here I’m basically just resetting my page, so this should it should effectively not let my page load anything because I’m clearing out the department number which is the primary key field of my report run this page and so now it doesn’t display anything right so what you should do is instead of binding directly to afield many people create a separate breadcrumb item so um you could make the break you could make the breadcrumb for this page it’s a completely separate hidden item and what you could do is you could then add logic to say and well if p3 or if p3d name has a value then use it if it doesn’t have a value then set it to something like a creation a new department.

So very quickly I’m going to go ahead and create a hidden item a hidden item here I’m just going to add it to and to my forum it doesn’t have a source or a database columns we’re going to fix that we’re going to call this p3 breadcrumb it’s not a database column it’s actually going to be a PSP else equal expression okay and we want this to always always happen so it’s always going to try to evaluate my breadcrumb and the expression here is going to be um we could do nvl too and we’re going to do that on actually just do n VL that’ll work just fine we’ll do it on p.3d name let me make this little bigger and we get my magnifier I’m sure that’s small my apologies poop and if that happens to be now will say create new department so it’s happy with that go ahead and shrink by magnifier here there’s my breadcrumb and in fact I’m actually going to cheat here and I’m just going to put it on my bread crumb item because it really makes sense, but that’s not if I’m almost done, but that’s not quite it.

I need to go ahead and put my breadcrumb value into my breadcrumb entry so if I go to my let me just go ahead and save changes let me go over to my shared components go find my breadcrumb edit the breadcrumb component and we’re going to change this from p3d name to p3 breadcrumb apply changes let’s go ahead and run the page see what we get okay so we get to create a new department and if I cancel and I edit a department it’ll oh I think I up my oh I know what I did wrong I need to remove this bit of code that’s right here go ahead and delete that you can use your delete button to delete it okay so if it’s null it’s going to say create a new department and if it has a value it’s going to say accounting or if you need to have more logic you can change the value of that bread crumb does that answer your question Jim kind of yeah.

So if there’s even more logic then you can just change this from go to bread crumb and you could change this from a peel sequel expression to a function body and so you can just return the final whatever the final output is so if you know if this then that and this that finally returns this, so that’s what you would use instead okay so I promised you some time beginning a class to go ahead and create the tree from the workshop does anybody feel like you open up part 3 there we go okay so you should be able to create configure this tree from the during the creation menu you shouldn’t need to go back and edit anything if it’s set up correctly and if it doesn’t get set up correctly and you’re going to have to go back to the tree attributes node and in there you can kind of configure all of this good stuff ok so I have a page and let me go back to my or I have an application here and I have a home page I’m not quite sure what’s on it at the moment let me just run it and see.

I have a lot of stuff here on my home page but I’ll add my tree it’ll work just fine so when I want to add a tree to an existing page well all I need to do is go ahead and edit that page so I’m going to edit page one and to create the tree all I need to do is click on the little regions button down in the drawer and go find the tree component and here I’m just going to right-click I’m going to add two we’re just going to add this to the content body and there’s a new region that I created before so I’m just going to make it going to make the tree after that I believe that’s my list region and now I’m going to go ahead and just change this and I’m just going to call this tree that the title doesn’t really matter and you could call it org chart because technically that’s what this is going to look like okay the source and will I have the source in my code sample here just go ahead and copy this and run or sorry save it.

Now what I can do is let me go ahead and run my page, yeah oh oh sorry sorry yep I’ll stop here you bet absolutely ok let me know when your ready ok perfect ok so we’ve entered the source for our tree and notice that it uses that kind of the start with and they connect by that we kind of talked about yesterday and also has the order siblings by and all three of these statements refer to a hierarchical query so they only work for hierarchical queries they don’t they won’t work in just a regular seat most sequel statement so when we run the page we now have this tree you should look something like-minded look a little different because I’ve modified my employee data but I specifically asked like when we mouse over this you can see um we don’t really get a tooltip right nothing’s really showing up and if I click on this errand it tries to take me to a page that doesn’t exist right.

So it tries to go to page one and then it tries to paint with page one does exist but it tries to set the item p1m know which doesn’t exist so I need to change two things I need to modify the link and I need to change the tooltip so to do that I’m going to go ahead and go back to my tree so I just go back to my designer page here click on my tree so let me go ahead and expand the source for my tree now this is where all of our solutions are going to differ slightly and well this part is going to be consistent what we’re going to do is we’re going to change the tooltip we don’t want to use the employee named the tooltip that we want to display even though it’s not displaying at the moment is empty no so we’re just going to select the amp no column let me get my magnifier for you to hold on there we go and so instead of just instead of selecting a name we’re going to select the employee number as the tooltip.

We can select all sorts of information here if we wanted to I could also add a job if I wanted to that would work that’s fine and the important part here or the last thing that we’re going to do and is we need to change this app page ID at whatever the form pages that you created just a little earlier so if your employee form is page six or five or four we’re going to put that here I’m just going to make mine 100 so I’m just going to go to page one hundred and I’m also going to make sure that I set P 100 amp now to my employee number, so this is going to be slightly different for you depending on the page that you created absolutely right okay youth and you got is you think you have the right link so far or you are you good at or in other words are you good with this screen sure ok yeah, so the tricky part here is just that word whoops me which was a better way I don’t know if there’s a way me if I hold window key now that won’t work the magnifier is very sensitive.

I need to be very careful otherwise it’ll shoot all around the page and we can so I guess what while we wait for that does anyone remember what the apex until dot prepare URL does for us if you say it in chat I can’t see because the magnifier so remember the reason why we’re encapsulating this an apex until dot prepare URL well that’s because in case our application has session state protection which by default pages do or form pages do it’ll make sure to add the appropriate session state protection checksum to the URL it will also encode the URL.

Leave a Comment