Create a Managed Bean for Page :-
- Follow the post "How to create an Oracle ADF Fusion Web Application?" to create an application, change Application name and suffix.
- Now we will create jspx page.
Create a jsf/jspx page, for this
refer to the post "How to create JSF/JSPX page by using Jdeveloper 12c?", change the page name to "TestPage2".
- Create a managed bean for TestPage2.jspx.
Approach 1:-
2. Now create a managed bean by clicking on add icon.
3. Following popup appears and fill the following fields :-
Bean Name :- Name of bean, Lets say "MyBean".
Class Name :- MyClass
Package :- Specify the package to keep this class.
Scope :- Specify the memory
scopes, we will select request scope.
Registration :- There are 2
options , One is configuration file, this will create a simple java file and
other is Annotation, it will create a java class with annotation.
Here we will create configuration
file.
Select the checkbox if we do not have any java class. and click ok.
4. You will see the entry of managed bean in faces-config.xml file.
5. Now this bean can be accessable on page.
I have a button on jspx page and now we will bind button component to that
bean.
Approach 2 :-
1. For this select the design view of TestPage2.jspx and double click on the component.
Popup will appear.
2. Mention the following details.
Managed Bean :- click on new, following popup appears.
3. Specify the following details:-
Bean Name:- MyBean
Class Name :- ShowResult
Specify the Package.
Scope :- Request.(you can select any scope according to the usage).
4. Now specify the method name in ShowResult class. Let say "resultFromOtherPage", and click ok.
5. Following class is created.
0 comments:
Post a Comment