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
About the Author
About the Reviewers

Sending custom events from a client to a server

In the previous recipe, we used clientListener and clientAttribute tags to call a function in JavaScript. We also had a bonus attribute accessible from the client side, but those attributes are not synchronized back to the server.

In this recipe, we will send custom data back to the server and send some payload with it. You can refer to the last recipe to do this, or you can grab this project's recipe by cloning the ADFFacesClientServerEvents application from the Git repository.

How to do it…

To learn how to send custom events from a client to a server, follow the ensuing steps:

  1. Open the events.jsf page.

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

  3. Right-click on the Email field from the Structure pane and select Client Listener by navigating to Insert Inside | ADF Faces.

  4. Change the Method field to changeClientEmail.

  5. Change the Type field to...