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

Adding conversion


In order to provide conversion from user string inputs to other object data types, ADF Faces input needs to be converted from string to the data type object and vice versa.

ADF Faces provides many converters out of the box so the developer doesn't need to create his own. Every input can be assigned to only one converter.

In this recipe, we will create an employee form that converts from java.util.Date to java.lang.String and from any number like double to java.lang.String and vice versa.

The application for this recipe and its model has been created for you. You can see it by cloning the AddingConversion application from the Git repository.

How to do it…

To know how to add conversions, perform the following steps:

  1. Open the AddingConversion application.

  2. Double-click on adfc-config.xml to open it.

  3. Drag view from Components palette and drop it inside the Diagram mode of adfc-config.

  4. Name the view employees.

  5. Double-click on view to create it, and then choose Default Hr Template as a...