There are certain cases when you want to render different components on page dynamically based on a changing model (think programmatic view object), and this cannot be determined before runtime. This can generate a huge code to generate components which can be very tedious for the developer.
Oracle ADF Faces provides a solution for the use cases with the af:dynamicComponent
tag. The af:dynamicComponent
tag can determine the component type to display and its value at runtime.
In this recipe, we will create a new page to see how can we display different input components based on of the EmployeeView
attributes using af:dynamicComponent
.
In order to use the dynamicComponent
, follow the ensuing steps: