Forum Stats

  • 3,827,284 Users
  • 2,260,758 Discussions
  • 7,897,197 Comments

Discussions

Issue with binding components from page fragments into managed bean when rendered as region

santiago_nc
santiago_nc Member Posts: 91
edited Jun 9, 2014 4:26AM in JDeveloper and ADF

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

Answers

This discussion has been closed.