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

Executing JavaScript within an event response


Executing JavaScript within an event response can be very useful when you have a JavaScript library that does certain things on the client side, and you want to call these functions after finishing an action on the server side.

In this recipe, we will simply add a warning message to the Phone Number component if the user enters anything other than a number as the first letter and return the focus to the component again. You can refer to the last recipe to do this, or you also can grab this project's recipe by cloning the ADFFacesServerClientEvents application from the Git repository.

How to do it…

To learn how to execute a script within an event response, follow the ensuing steps:

  1. Open the events.jsf page.

  2. Drag the PhoneNumber field by navigating to Chapter7DataControl | EmployeesView1 and drop it inside the panel form layout by navigating to Text | ADF Input Text w/ Label.

  3. Select the PhoneNumber field from the Structure pane.

  4. Change the AutoSubmit...