Databases Reference
In-Depth Information
6. Managed beans can be added to the page in the Managed Bean secion. Right now,
we will have one backing bean associated with the page. Select the Automaically
Expose UI components in a New Managed Bean opion only if you have a strong
reason to bind each of the UI components to the bean, otherwise we do not need
to select this opion now. Usage of a backing bean rather than a managed bean is
applicable if you are creaing your own declaraive component which is out of the
scope of this topic.
7. Click on OK to create the page.
What just happened?
Now we have our page created which uses the page template for a common look layout.
If you have opted to create the backing bean, the Dept.java file will be created for the
dept.jspx file. The Java class will have all the bindings for the UI components added to the
dept.jspx page. The dept.jspx page currently has af:document and af:form as the
UI components in the page. Each of these components will have the binding atribute added
to it which will have a binding to the corresponding value in the backing bean. For example,
af:form will have the binding as #{backingBeanScope.backing_dept.f1} which
means that the form component is bounded to the f1 atribute in the Dept.java file.
backingBeanScope is the scope that is very speciic for the backing bean. The lifeime of
the object in backingBeanScope is within the scope of the backing bean. There are several
scopes, but at this ime you don't need to worry about them. If you look closely in the Dept
bean, you will have the references added to the backing bean.
The geter and the seter for the f1 reference are used to get and set the binding for the
form element in the page. This is useful if we have to give reference to the form element in
our code at runime. Also, note that the component reference in bean is of type RichForm
and the reference for the document element d1 is of type RichDocument . Each of the UI
components will have their own class type API in Java.
The scope of the backing bean can be backingBeanScope , sessionScope , viewScope ,
pageFlowScope , and applicationScope , and is defined in the Managed Bean secion
of the adfc-config.xml file.
 
Search WWH ::




Custom Search