Book Image

Oracle ADF Faces Cookbook

By : Amr Gawish, Amr Ismail Gawish
Book Image

Oracle ADF Faces Cookbook

By: Amr Gawish, Amr Ismail Gawish

Overview of this book

Table of Contents (18 chapters)
Oracle ADF Faces Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Using ADF Faces client events


Most ADF Faces components can also work with client-side events. Handling events on the client side saves a round trip to the server. JavaScript replaces managed beans to handle client-side events. This JavaScript can be inline on the page or in a separate JavaScript file.

In this recipe, we will create a client listener to capture the change in the value of the LastName attribute and alert the end user about the change. You can refer to the last recipe to do this, or you can grab this project's recipe by cloning the ADFFacesClientEvents application from the Git repository.

How to do it…

To learn how to use ADF Faces's client events, follow the ensuing steps:

  1. Open the events.jsf page.

  2. Select the LastName field from the Structure pane.

  3. Right-click on it, select Client Attribute by navigating to Insert inside | ADF Faces, and click on OK.

  4. Change the Name attribute to label.

  5. Change the Value field to #{bindings.LastName.hints.label}.

  6. Right-click on the LastName field from...