Book Image

Oracle ADF Faces Cookbook

By : Amr Ismail Gawish
Book Image

Oracle ADF Faces Cookbook

By: 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 client-side capabilities to the converter


ADF Faces converters are JSF converters with client-side capabilities that can save a round trip to the server if not converted correctly.

In this recipe, we will create a new converter with client-side capabilities to check whether the value is a valid XML syntax or not. Then, we will apply this on the CodeSample attribute. You can continue from the previous recipe, or you can grab this project's recipe by cloning the CreatingCustomCSConverter application from the Git repository.

Getting ready

In order to create a converter with client-side capabilities, we need to do two things:

  1. Create a JavaScript version of the converter following the Trinidad documentations.

  2. Create a class that implements javax.faces.convert.Converter and org.apache.myfaces.trinidad.validator.ClientConverter interfaces and override its methods.

  3. Register the converter inside the faces-config.xml file.

  4. Apply the converter on input components.

The second step is important since...