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:
Open the
AddingConversion
application.Double-click on
adfc-config.xml
to open it.Drag
view
from Components palette and drop it inside the Diagram mode ofadfc-config
.Name the view
employees
.Double-click on
view
to create it, and then choose Default Hr Template as a...