June 6, 2013

Invoking javascript method from an ADF component


This post is to show how we can invoke a java script method from an ADF component like af:goLink

Write a javascript. We can also use external javascript file but in this example I am writing a small
javascript method using af:resource. Below is my java script method.

<af:resource type="javascript"> 
function sayHello() {
alert(“Welcome to Hello World”);}
 </af:resource>

Create a af:goLink component on the JSF page like below.

<af:goLink text="Click here" id="gil1" >
<af:clientListener method="sayHello()" type="mouseUp"/>
</af:goLink>

No comments:

Post a Comment