Hello, in this video I will talk about with ADF component listener. This is one of the most important thing you have to know about ADF component that any component has listener it means you can do something programmatically once once you deal with this component. So, in general listener means you do some action in this component and you want to meet write your custom code depending on this action. In this course, I want to talk about with some listener and some component like I will talk about that tab button tap listener. If you have any burning tab in your if application, how will you deal with the listener of the panel tab in boot tickets? What is the most important listener in boot tickets you can use?
Drop down list, pop up table selection lists to value listener and Bennett books. Listen, this is the most important component actually you will use your ADF application and you sometimes need to work with the listener of this component there are some other component will be similar what we are talking about like for example, what we will talk about the tap listener, but if the person wants and is not it is same like in their bedding accordion. So, when an accordion they will be same like panic tab if you talk about in verticals it will be same like in would date if you have a mood it would be D like same in verticals or input file okay. So, list of values can be a list of value or select one list of value. So, once I took about one component i will tell you what is the other components similar to this.
So, let us now start with that tab list when it tabs. Here I have created a diff application was a model department in bill v entity and the view symbol and they created one beach with some tips to describe each listener in a different so let's start with the benefit of listener. So once you use elect now we have here a benefit at this step you need sometimes once you the user, press or enter to the tab to execute some code before the user enter to the tab or once the user exits the tab, you want to secure some code for doing anything. Okay, so this is the template is not here. I will add a tab to describe their listener. Then, tap and they will tap example he bought and Please, okay.
For example you have two tabs one department one buoy. Okay. Let us drag the main department here. Table. singer for selection, okay. For the second step, I will record the mean in between here as a table like this this just runs a beach and have a look on it.
Okay, so here our we already set up so now we have two tabs the Berkman simple UI departments will display all departments employees will display all employees all employees for all departments. So okay let's do something now I need once the user select MVP, I need to get the current selected department and the filters down below for example, if I select the department 120 once I go to the in between here, I need in the tablets are now wants to use or Bridgman says tab, I need to get the selected department and the filter symbol we of course this is actually combined can be done without anything if you select the employee which is detail to the department if you select this here, so once you select the department this will filter automatically, but in this case Zombies, I just want to show you how you can execute code once the user selects a specific tab or working with tab.
So, now, if you have a look here in the tip, for example, example to each step which I need to make an action, once the user base or the step or you need to filter the bill binding on the selected department, so I will add a listener in the employee tab. So I will select this employee tab. Most of the listener will be in cell phone setup. So I will select that once you will find all behavior sorry behavior tab you will find here disclose our listener. So in the disclosure listener, I will map this property to Mr. danza Bagby in a listener will map to the MR danza backbeat because this not means do so. Some some good ones that is not as happy.
So, I will disclose a listener I will edit and I will create a new beam, call it my pin my pin and I would add it in Zeppelin folder. souls have been here is created, I will press new and they will call me up to this actually this listener will fire once the user enters a tap or lift is a tap. Now I lift is attached to the department or enters a tap this listener will be fired. If you want to check this is a been method here, this is our listener. We can write just soup I am in ambu we tap this okay and let us run again and see when exactly this thickest will be printed in the lock. Okay, so now let us first clear the look okay, and we will see when exactly this text will print it.
So we'll just now press on the employees tab. Let's have a look. You will find stickers. is printed means it is entered to the tablet Okay, can you read it again and get out you will see it is printed as well. So, once the user enter here or lift is a tap, it will introduce the listener. So, how you will know when the user is entered or when the user is lift, you can do gnosis by this object disclosure event.
So, once once you take this object and right.is expanded, this method is expanded will be true if the user enter to the tap and will be false if the user lift to the tap, okay. So, if you want To execute some code only if the user interacts with a tab you have to write F and take the event listener here, though, is expanded. write the code here. User Interface setup if you want to enter to write a code once there's a lift the tap, user lift okay. So, we need in our example need to write to get the department ID and filter the employee view object poises department ID. So first I will get the binding so I will write here point to container binding equaled by in the contiguous would get caught under get corresponding entry now I get the binding I think I showed you this before this is import binding tuner which will be binding and we can board buying the ticket as well.
So after that I need to get the selected document ID so I will say DC a three two buying think I need to be a traitor the traitor equal I need this a traitor to get from a binding So, I will it is important this year three two binding. So, binding dude get and we can write a treat or name here. It has costs the output to this year three pointing here this is take the iterator name I will go to the beach definition. We will find the bottom interview one I traitor, I need to take this support department we want to iterator ID and I will put it here. So, first step I get the binding which is this from this binding I get a traitor a traitor I will get the current row to row equal it dipped iterator dot get current row, I need to get the current row which the user select for example, if I select department 100 so I need to get that Selected hours according to all of this iterator, because in the table selection listener, we say once the user selects a row mark is this row as a current row in the iterator Okay.
So now I got I get to go to the binding, get Zeit rater, then I will get the selected row or the current row here. Oracle do GB or to throw or equal get economy Pro. After that I would see object ID equal row dot get attribute and I need to get the attribute name of the view option. So a Ferris like it's a binding second, get The iterator cert I get the current row and the front row I need to get the attribute name. So, I will see this is attribute name which I need to get here. So here I get the department ID after that I need to get Zef in believe you object and the filter it so the second step I will get the I traitor of the MBE invite rater to will be here.
After I get the embed retry you want to get the view object so you will quote the object m vo equal from a traitor I will get the view object to Get in view object form of view object.we have to import imported okay here are going to be aborted now. So in the view object dot sit in we're close we can sit or close or create view criteria in anything you want to do, you can create a view criteria or you can set a workload. So, in this example, I will show you how to consider or close is the bank been sitting will close from the P is open query. I will say department ID underscore ID equal loss and we sit department at Then m v o dot execute query Okay, so this is what we did here. Here I get the department ID is the selected department ID.
Here I felt resemble we with the selected department where I would this in the disclosure listener offset tab. Once a user press in it, it is expanded, I will go to the binding get the department I traitor gives the current throw from zero I will get the department ID then I will get there in blue a traitor from the traitor I'll go to the View object I will sit over close of the view object and I will execute query of the view option. So let us now try to run this again and have a look Okay, so let's for example, Now select the bottom and problem 30 and in between these you will find the department is 30 and in the log you'll find here expanded equal true. So, it is entered here, if I left the department you will find to expand it is false.
So, it will not enter to this code. If I select in another department, for example, finance in movies, you will find it is good sir in between. So this is how you can work with the listener of the benefit step. And if you want to execute some code, once the user selected tab or lifter tab, you can do it in Their behavior is a disclosure listener for a variety of the show detail item. This is the listener is a bonus tip and this can be done as well in the Bennett accordion. So the same exact what we do in the benefit tab you can do this in the Bennett accordion component.
Bennett accordion suspended accordion will have as well. tabs and you will deal as exactly same like you do in Spanish. Okay, this is how you can work with Ellison as a mentor. Nick is the video I will go to for the input ticket. So see you and you can see it you