Hello, in this video I will show you how you can use Chava script inside ADF application. I will try to cover as much as I can for the most important JavaScript function, which you are usually used in ADF application. So here I have created a PDF application called JavaScript in the publication. With me we and department is a model. So let's now try to create a beach. And I will show you how you can call the JavaScript inside this beach.
So I will call it GS JavaScript. And this is will be and mth JavaScript, you can do a lot of things using JavaScript you can control some existing PDF components speech, or you can call methods xebec bien. So all you can cancel the request at all or you can control right click on the page or there are a lot of things you can do in JavaScript. So let us now try to create a symbol symbol component is a beach that was added here. Banner will be our site and then grow below it we can add just a symbol to bottom here I can add but better for you, I would just I will insert some PDF component in the beach. That's all okay.
And let's just add one input date. Okay. And this is been a group layout, and we can make a layout with horizontal. Okay, so now we have PDF which is, which has some PDF components to add JavaScript in this page. And as I said speech if you want to add JavaScript to execute some code. There, there is a standard way you can add JavaScript in word and so is the beginning of the page in the bottom.
But I prefer to have a standard way to add a JavaScript says, If document, you can displays a facet of the document or only one piece it will meet a container. Inside this meter container, we will add our JavaScript zero EDF component that will tell the beach This is a block of JavaScript. So there is this component Cool resource. So I will add here if component core resource. This is actually GCP GCP tech, that's fine. This is all JavaScript.
So I will use a resource and I will select the type will be JavaScript and the press OK. So inside this resource, we can start writing our own JavaScript. Okay. So let us try to do a simple JavaScript all you need to do once the page is open, I just want to display or to display a lot from the JavaScript. So how you can do this. So is the is a free resource.
First you can create it is open source like this. So now this is inside, if resource one and so I will just write function Display alert. Okay, this is a JavaScript function display alert and I will write alert. I am in G JavaScript function. Okay. So now you have here a function JavaScript function and you want to call this function from somewhere in your Ph.
EDF application. So how you can do this, you can use client listener insights the component which you want to display this a lot. So, for example, here are a few input tickets or you won't want to use a focus on this input tickets or press on it or click on it. I need to call this display alert. Okay, so So, how you can do this you can insert in sizes input text, if component call client. So client listener is component which we will use to call a JavaScript function.
Here, he asked you what is the method name? So we give the method name, splay. Alert. And what is that action, which you want to call this, there are some built in action in JavaScript. If you want to click or double click or context menu, like right click, if you just focus if you're always in the focus in this a multicast key brisky up mouse over mouse out with all these things, so I can maybe make click chance he wants to click on this, I need to call this function. Okay, so let us know run and test this symbol function Okay, so now this is a bitch.
Let us now try to click on the first one which right? Once you click it you find the missile, our alert is appear with I am Angel, she is function. So now I can call the JS JavaScript function using client listener inside the component. This is how you can create a JavaScript function and the higher you can call it from one of the ADF component. Nicosia video, I will go into detail and try to work on this JavaScript with ADF combined this video only to show you how you can create a JavaScript block and how you can call it from any ADF component. So see you next activity.