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

Working with dynamicComponent


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.

How to do it...

In order to use the dynamicComponent, follow the ensuing steps:

  1. Open the adfc-config.xml file.

  2. Drag a view and name it dynamicComponent.

  3. Double-click on the newly created view and choose the Oracle Three Column Layout template.

  4. Drag EmployeesView1 under Chapter4AppModuleDataControl from the Data Controls pane and drop it...