What is ADF Backing Bean
ADF Backing Bean is similar to a Java Bean. The backing Bean holds all the property and function of a JSF UI components. For each JSF page, we can have a backing bean
BackingBaen holds all the UI component properties and functions. Let’s take a UI component inputText
- The backingBean has the value of the inputText
- The backingBean has an instance of the inputText so that it can be changed at runtime
- The backingBean has validator function of the inputText, performing any custom validation
- The backingBean has the converter function of the inputText, performing the conversion
- Also, it performs the following function
- The backingBean has the actionListener or action method, triggered when submitting a form
- The backingBean has the Navigation function, for moving to another page when a button or link is clicked
Create an ADF Backing Bean
We can create a backingBean while creating a JSF page.
In JDeveloper Go to File >> New >> New Gallery >> Web Tier >>JSF page >> Enable the Select one Choice ‘Automatically Expose UI Components in a New Managed Bean’ and enter the following property
Name: Input a name, the name will be referred to within the application using EL expression
Class: Java class name for the Backing Bean
Package: Enter a package name or Browse an existing package for java class to reside
The ADF Backing Bean will get created under the viewController under the package you have mentioned above
Create a Validator function in an ADF Backing Bean
Double click on a UI component (ex: InputText ) in JSF page >> Choose existing Bean in the combo box or click New to create a backingBean >> Input a name in method field
The validator method gets created in the backingBean, using uiComponent object we could process the input text and validate it. ADF process this validation during the lifecycle.
Creating ActiionListener in BackingBean
Click on a command button >> Expand Behaviour >> click the ActionListener >> Choose New or Click New to create a new Bean >> Input a method name
A method gets created in the backingBean. The method gets called whenever the button is clicked.
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂