Hello, last video, I show you how we can call a function embed been from the JavaScript function in the page. In this video, I will show another example for how you can call function embed being from the JavaScript function, but you need to send some parameter and how you can send some Brompton from JavaScript function to the function in sabac bean. I will give you an example which I always I did a lot of time before, which is in the table if you have a table in the page, you want to want to use a double click on the row in the table to do something like you want to open up or you want to do anything. So to see some detail, so in this example, I will display here department as a table if they will, okay. And I need once the use of double click On any row of the department, I need to open a pop up with detailed invalidity of the selected department.
I did this a lot before says the customer asked once he double click in a row in the table a detail Bob should be open. So I will do this here. And I will show you even how we can code JavaScript from the back beans. So now this is our department table. And all you need to once the use of double click on it, or you need to send some parameter to the JavaScript on JavaScript since this parameter to a client server. So here inside the table itself, I will add same two things if client listener and server listener.
So size a table, my table here, this is my table. I need to add Like this, sometimes you can see give you an error set the table will not accept client or server listener, but it's okay you can do it. So here I say is a table add client listener, and the type will be double click. So I will double click and once I double click, I should call a specific function. So here I can call table. Double click and I should create a function here called table double click and it is it Okay, okay, so now let us have a copy of this as well.
Here and here I should write my serve cold server, we can call it cold table server. So I will call table server and you will add it in our server listener. And here I will write some other function call it dip table, double click this, okay. This is a function which will be will be called from the JavaScript. So here again I add here client listener server listener says a table client listener will call a function called table double click once the use of double click on it, and the table double click will call server listener core call to table server which will be here cool table server and it will it will Call the department table double click watch. The other thing I need to show you show you how you can send the barometer.
So, if you want to send a specific parameter to the JavaScript function a JavaScript function takes this parameter and send it to that missins backbeat you can add here something called client attribute. So, actually this is an IF but sometimes not all thing is to should be a bit here you need to edit manually okay. So, you should add here client attributes. So I will add here. If you open any other things like this, if you add here if this is you will find here client attribute like this. You can just check it copy like this has name and value.
Okay, and you should manually edit Size a table because sometimes the table didn't accept some client or JavaScript component you can manually add. And here but attribute you can have something two things in name and value like key value. So in here, I can see it dipped name. and the value should be department binding department name. What is oh books role? department ID, this is a value.
So I would put thickest I will send it to the client. Okay, so you will find here something great because it did accept the client attribute. That's fine. So the client attribute here name, the name and the It will set the values row to department ID which is the value root department ID I will send it to here, this is the first step second step I need to send desist or in the JavaScript I need to receive this dipti name. So, I will go to the Java script which is a table double click here and I need to receive this value. So I will go over it name equal source dot get property of depth name.
So here you will take the event ticket source and once you get the source do seek get ID property and get the department name. The current attribute name Deepti name. Okay, so here I will see department name after that I need to send it to the back been. So, this is actually a barometer area. So, you can just simply see about me names in column and like department This is the value and this is been variable which I will receive if you have multiple parameters you can just simply add comma and add the second one and so on. But here we have only one parameter.
So, I will receive the department name from the client listener and I will send it to the B function in the back. So, here I need to display it so I will write here string dipped, name equal client event. This object which sent book Get parameters dot get and give the department name and it will cost two to string then I will just splay sir it doesn't know just drum and chick. If I double click I will receive so department name or not. After that we can display the pop up in the bag been sold it has now run and it shakes us. Okay so this is the workbench so we can change the banner layout and increase the width of the panel.
Splitter pot now, I need to just this is the department name value will be sent to the MR Oh no. So, I will double click here and I will have a look here you will find the bottom it is not so, it is not sent to the back been here this why this is sometimes having years in decline theater and plant attribute it will not get value inside the table since what should get value from somewhere outside the table. So, what I will do, I will just drag the bottom team have the same view object which is the table reads from just outside the table as an output text just like this and I will take the value of this. I will take this and I will set it to the client makes this attribute so there was a value getting from the binding not getting from the table Okay, now I can remove this I don't need this now.
So now is the client attribute we'll get the value from a binding and let us change the binding globally to be vertical and we can crease maybe 500. So let us now try to run again. And to check if the selected department will be sent from the JavaScript to the method is a big beat or not. So it's run okay. So let us now again try to just clear this and if I double click in the finance department, now you will find it is sent correct. It will double click when for example, in this Calling correctly.
So now the value is sent correctly from the JavaScript client listener to the function in JavaScript and from functions JavaScript we sent it to the back been niggas video, I will show you how you can display a detailed pop up once a user double click on the rows