Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Issue with binding components from page fragments into managed bean when rendered as region

I have detected an issue when I binding a component into a managed bean from a page fragment which is a View of a TaskFlow exposed to JSF as a Region.
This issue happened when I exposed same TaskFlow as region two or more instances in the same JSF. The component which is binding only rendered in last Region.
Jdeveloper 12c (12.1.2.0) ADF12c.
This is the code:
Page Fragment:
<?xml version='1.0' encoding='UTF-8'?> <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> <af:panelGroupLayout id="pgl1"> <af:inputText label="Label 1" id="it1" binding="#{bindingComponentBean.inputText}"/> <af:button text="button 1" id="b1"/> </af:panelGroupLayout> </ui:composition>
Managed Bean(in Request Scope)
package com.edisa.test.errors.view.backing; import oracle.adf.view.rich.component.rich.input.RichInputText; public class BindingComponentBean { private RichInputText inputText; public BindingComponentBean() { } public void setInputText(RichInputText inputText) { this.inputText = inputText; } public RichInputText getInputText() { return inputText; } }
TaskFlow
<?xml version="1.0" encoding="UTF-8" ?> <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2"> <task-flow-definition id="TestTaskFlow"> <default-activity>test_fragment</default-activity> <managed-bean id="__1"> <managed-bean-name>bindingComponentBean</managed-bean-name> <managed-bean-class>com.edisa.test.errors.view.backing.BindingComponentBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <view id="test_fragment"> <page>/fragments/test_fragment.jsff</page> </view> <use-page-fragments/> </task-flow-definition> </adfc-config>
JSF Page
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html> <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> <af:document title="index.jsf" id="d1"> <af:form id="f1"> <af:pageTemplate viewId="/oracle/templates/threeColumnTemplate.jspx" id="pt1"> <f:facet name="center"> <af:panelGridLayout id="pgl1" inlineStyle="border: 1px solid #eee;"> <af:gridRow marginTop="5px" height="auto" marginBottom="5px" id="gr1"> <af:gridCell marginStart="5px" width="50%" id="gc1" inlineStyle="border: 1px solid #eee;" halign="stretch"> <af:panelBox text="Region 1" id="pb1"> <f:facet name="toolbar"/> <af:region value="#{bindings.TestTaskFlow2.regionModel}" id="r2"/> </af:panelBox> </af:gridCell> <af:gridCell marginStart="5px" width="50%" marginEnd="5px" id="gc2" inlineStyle="border: 1px solid #eee;" halign="stretch"> <af:panelBox text="Region 2" id="pb2"> <f:facet name="toolbar"/> <af:region value="#{bindings.TestTaskFlow1.regionModel}" id="r1"/> </af:panelBox> </af:gridCell> </af:gridRow> </af:panelGridLayout> </f:facet> <f:facet name="header"/> <f:facet name="end"/> <f:facet name="start"/> <f:facet name="branding"/> <f:facet name="copyright"/> <f:facet name="status"/> </af:pageTemplate> </af:form> </af:document> </f:view>
Best Answer
-
Bind component to backing bean scope'd bean.
Actually, this is the only purpose of backing bean scope - to distinguish two or more instances of component from the page fragment.
It has the same length of life as the requestScope but for different instances of regions/declarative components you will have separate instances of backingBean scoped managed beans.
http://adfpractice-fedor.blogspot.com/2012/03/managed-bean-scopes-for-page-fragments.html
Answers
-
Bind component to backing bean scope'd bean.
Actually, this is the only purpose of backing bean scope - to distinguish two or more instances of component from the page fragment.
It has the same length of life as the requestScope but for different instances of regions/declarative components you will have separate instances of backingBean scoped managed beans.
http://adfpractice-fedor.blogspot.com/2012/03/managed-bean-scopes-for-page-fragments.html