Iterator returns no records in managed bean

Yes, its time to talk about the old SelectManyShuttle again! Well I've tried my hand at revising some blog code for the managed bean this time in order to populate and control the shuttle. But the binding is giving me the blues. Here's the code. It's not copmplete but it's enough to debug and see that the Iterator is CAPUT!
package nebula.view.backing;
import java.util.ArrayList;
import java.util.List;
import javax.faces.model.SelectItem;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.binding.BindingContainer;
public class RoleShuttleHelper {
private BindingContainer bindings;
private SelectItem[] allRoles = null;
private List manyShuttleValue;
private List initialSelectedValue;
public void RoleShuttleHelper(){
public SelectItem[] getAllRoles () {
if (allRoles == null) {
DCIteratorBinding rolesIt = (DCIteratorBinding) this.getBindings().get("AuthGroupView1Iterator");
allRoles = new SelectItem[rolesIt.getAllRowsInRange().length];
manyShuttleValue = new ArrayList();
for(int i=0; i < rolesIt.getAllRowsInRange().length; i++){
SelectItem item = new SelectItem();
item.setLabel(rolesIt.getAllRowsInRange().getAttribute("GroupLongName").toString());
item.setValue(rolesIt.getAllRowsInRange()[i].getAttribute("GroupId"));
allRoles[i] = item;
initialSelectedValue = manyShuttleValue;
return allRoles;
public void setBindings(BindingContainer bindings) {
this.bindings= bindings;
public BindingContainer getBindings() {
return bindings;
It looks like rolesIt.getAllRowsInRange().length is returning an undefined value. The causes the for loop to be skipped over. I assume this means that no rows have been fetched. Can anybody help? I've also added the XML for my managed bean to the adfc-config.xml here is that listing:
<?xml version="1.0" encoding="windows-1252" ?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
<managed-bean>
<managed-bean-name>backing_AdminPage</managed-bean-name>
<managed-bean-class>nebula.view.backing.AdminPage</managed-bean-class>
<managed-bean-scope>backingBean</managed-bean-scope>
<!--oracle-jdev-comment:managed-bean-jsp-link:1AdminPage.jsp-->
</managed-bean>
<managed-bean>
<managed-bean-name>RoleShuttleHelper</managed-bean-name>
<managed-bean-class>nebula.view.backing.RoleShuttleHelper</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>bindings</property-name>
<value>#{bindings}</value>
</managed-property>
</managed-bean>
</adfc-config>
Thanks!

you can try this too..
    public SelectItem[] populateShuttle(String iterName, String tmpValue, String tmpLabel){
        DCIteratorBinding iter= getBindingsForDCB().findIteratorBinding(iterName);
        int startIdx = iter.getRangeSize();
        iter.setRangeSize(-1);
        Row[] rows = iter.getAllRowsInRange();
        SelectItem[] shuttleElements = new SelectItem[rows.length];
        SelectItem item = null;
        if(rows != null && rows.length > 0){
           for(int i=0; i<rows.length; i++){
               Row r = rows;
String attribute = r.getAttribute(tmpValue).toString();
String label = r.getAttribute(tmpLabel).toString();
item = new SelectItem();
item.setValue(attribute);
item.setLabel(label);
shuttleElements[i] = item;
iter.setRangeSize(startIdx);
return shuttleElements;

Similar Messages

  • How to get iterator values from a managed bean ?

    Due to a bug in selectOneChoice i'm not able to get the label list i want to display directly from an iterator when the value binding is a managed bean.
    To solve the problem i would like to create a managed bean that contains that list and use it as the selectItems to display.
    I would like that the values in that managed bean loaded from the a data control iterator.
    My question is :
    1) is it possible to access the iterator values from a managed bean, i mean without any reference to a page definition
    2) how to do ? is it documented somewhere ? any example ?
    Thank you

    I got it also with this code:
    package view.managedBeans;
    import classification.bean.ClassificationDocument;
    import classification.castor.ClassificationLanguage;
    import java.io.FileNotFoundException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.List;
    import java.util.Locale;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.generic.DCGenericDataControl;
    import org.exolab.castor.xml.MarshalException;
    import org.exolab.castor.xml.ValidationException;
    public class ClassificationLanguageList {
    private java.util.List<SelectItem> supportedLanguages = new ArrayList();
    public ClassificationLanguageList() throws FileNotFoundException,
    MarshalException,
    ValidationException {
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding("#{data.ClassificationDocumentDataControl}");
    DCGenericDataControl classificationDocumentDataControl = (DCGenericDataControl)vb.getValue(ctx);
    ClassificationDocument classificationDocument = (ClassificationDocument)classificationDocumentDataControl.getDataProvider();
    ClassificationLanguage[] classificationLanguage = classificationDocument.getClassification().getClassificationLanguageList().getClassificationLanguage();
    for (int counter = 1; counter < classificationLanguage.length; counter++) {
    SelectItem language = new SelectItem();
    language.setValue(classificationLanguage[counter].getClassificationLanguageCode());
    language.setLabel(classificationLanguage[counter].getClassificationLanguageLabel());
    supportedLanguages.add(language);
    public void setSupportedLanguages(java.util.List<SelectItem> supportedLanguages) {
    this.supportedLanguages = supportedLanguages;
    public java.util.List<SelectItem> getSupportedLanguages() {
    return supportedLanguages;
    }

  • ADF reading dirty records programmatically in managed bean

    Hi,
    I have a ADF Table in which one column is a input text field.If we make change to any of the rows and press update button ADF BC recognises the dirty records and updates them.I need to read those rows in managed bean as i need to update some other fields of that row programmatically.
    Any ideas..
    Thanks in advance.

    Thanks Frank..
    In value change listner we get the new value and old value only.. How can we get the complete row details..I thought of getting the row details from the iterator by passing the selected row index ..
    but there can be multiple rows selected ..
    Is there any other possible solution to get the other attributes of the same row in valuechangelistner..
    Thanks in advance

  • Managed bean returns null on SetActionListener

    Hi,
    I'm trying to implement a filter for my table (something similar to what's done in the "OracleAS 10g R3: Oracle ADF for Forms/4GL Developers/Volume II" student guide, practice 9-5). The idea is to have a request-scoped managed bean which holds the filter value - the value is set using a SetActionListener, and later bound to a bind variable in a view with a view criteria. I have problem re-creating this in Trinidad (JDev 11 TP3, to be exact).
    I have created a request-scoped bean in adfc-config.xml (called 'ecnStatusBean'), with a managed property (named 'Status'). I am referencing it from my SetActionListener: setting #{'E'} to #{requestScope.ecnStatusBean.Status}. The reference compiles fine in the Expression Builder (it didn't before I created the managed bean), but when running and clicking the CommandLink with the SetActionListener, I get a runtime error:
    oracle.security.jazn.JAZNRuntimeException: Target Unreachable, 'ecnStatusBean' returned null
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:480)
    To make things more interesting, I tried changing the scope to session, and got a different error:
    oracle.adf.controller.ControllerException: ADFC-10001: Cannot instantiate class 'pelephone.cdma_ecn.ecn_manager.model.ecnStatusMB'.
         at oracle.adfinternal.controller.util.Utils.createAndLogFacesException(Utils.java:169)
    Am I doing a rookie's mistake? Is this a Trinidad issue? Something else?
    Thanks in advance for any help,
    Boris

    Are you sure about the reference you use here: #{requestScope.ecnStatusBean.Status}.
    Here is a simple sample of what works for me:
    The first page has this:
          <af:form binding="#{backing_start.form1}" id="form1">
            <af:inputText label="Label 1" binding="#{backing_start.inputText1}"
                          id="inputText1"/>
            <af:commandButton text="commandButton 1"
                              binding="#{backing_start.commandButton1}"
                              id="commandButton1" action="go">
              <af:setActionListener from="#{backing_start.inputText1.value}"
                                    to="#{backing_start.paramToPass}"/>
            </af:commandButton>
          </af:form>It references a bean that has this:
        private RichInputText inputText1;
        public void setInputText1(RichInputText inputText1) {
            this.inputText1 = inputText1;
        public RichInputText getInputText1() {
            return inputText1;
        public String paramToPass;
        public void setParamToPass(String paramToPass) {
            this.paramToPass = paramToPass;
        public String getParamToPass() {
            return paramToPass;
        }And then I can see it in the next page that I navigated to like this:
            <af:outputText value="the current value is #{backing_start.paramToPass}"/>In the adf-config.xml I have this:
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <view id="start">
        <page>/start.jspx</page>
      </view>
      <view id="end">
        <page>/end.jspx</page>
      </view>
      <control-flow-rule>
        <from-activity-id>start</from-activity-id>
        <control-flow-case>
          <from-outcome>go</from-outcome>
          <to-activity-id>end</to-activity-id>
        </control-flow-case>
      </control-flow-rule>
      <managed-bean>
        <managed-bean-name>backing_start</managed-bean-name>
        <managed-bean-class>backing.backing_start</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
    </adfc-config>

  • Dynamic Declarative Component managed bean returned null

    Hi,
    In a project from an application a DDC component is defined. This component uses a managed/backing bean with view scope.
    Using this component inside this project is working fine. This component should be used in other view controller projects, and here where the problems are.
    This project(let's call it Common) is deployed as ADF Library jar, and used in the other V-C projects.
    The big problem is that the managed bean defined for the logic of this component is not 'reacheable'.
    (Another problem is that the attribute value is not seen as its EL expression but as string, for this i found a workaround.)
    In project Common the adfc-config.xml file:
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <managed-bean id="__4">
        <managed-bean-name id="__2">ExtendedShuttle</managed-bean-name>
        <managed-bean-class id="__1">com.xyz.portal.taskflow.common.extendedshuttle.ExtendedShuttle</managed-bean-class>
        <managed-bean-scope id="__3">view</managed-bean-scope>
      </managed-bean>
    </adfc-config>A part from component declaration:
          <af:table var="row" rowBandingInterval="0" id="ta"
                                  rowSelection="multiple" columnStretching="last"
                                  disableColumnReordering="true" fetchSize="-1"
                                  binding="#{viewScope.ExtendedShuttle.allItemsTable}"
                                  value="#{viewScope.ExtendedShuttle.allModel}"
                                  partialTriggers="::dc_cb5 ::dc_cb3"
                                  filterVisible="true"/>The root exception is :
    javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
    This exception is throw on com.sun.faces.application.ApplicationImpl.createComponent when *#{viewScope.ExtendedShuttle.allItemsTable}* is evaluated.
    Caused By: javax.faces.FacesException: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:262)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createFacet(UIComponentClassicTagBase.java:510)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:661)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1142)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:70)
         at oracle.adfinternal.view.faces.taglib.UIXTableTag.doStartTag(UIXTableTag.java:41)
         at oracle.adfinternal.view.faces.unified.taglib.data.UnifiedTableTag.doStartTag(UnifiedTableTag.java:50)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
    Caused By: javax.faces.FacesException: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:262)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createFacet(UIComponentClassicTagBase.java:510)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:661)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1142)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:70)
         at oracle.adfinternal.view.faces.taglib.UIXTableTag.doStartTag(UIXTableTag.java:41)
         at oracle.adfinternal.view.faces.unified.taglib.data.UnifiedTableTag.doStartTag(UnifiedTableTag.java:50)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
    Caused by: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.el.parser.AstValue.getTarget(AstValue.java:88)
         at com.sun.el.parser.AstValue.setValue(AstValue.java:133)
         at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:255)
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:259)
    Can you help figure it out, why is not working or why the managed bean is not visible in other projects but only in the one where the component is defined?
    Thank you for your time,
    Bogdan
    ps: how can i format the source code, on this fourm?

    Hi Frank,
    Thank you for the answer.
    I must say i'm quite new with ADF technology and maybe my questions are silly.
    Here is a Quote from "Oracle Fusion Developer Guide - Building Rich Internet Application with Oracle ADF" by Frank Nimphius and Lynn Munsinger Chapter 15 page 498:
    "You build dynamic declarative components *instead* of tag library based declarative components, if component resuse is required *only within the application* that has the component defined."
    Maybe i misunderstand the meaning of application from this sentence, but i need this component in several ViewController projects from only one application (ADF application).
    Tag lib declarative component I would not like to have, since the (automtically) build process is not my responsability and it will take some time till is pinpointed, but still is a last resort.
    Anyway two things are strange:
    1. Why the component is still available in other projects(and the beans not)?
    2. Why when a binding variable (for example: of type FaceCtrlHierBinding) has the correct type in the declarative project and in the order projects is of type String and its value is the variable name?
    Example:
    <af:declarativeComponent ...
    AllItems="#{bindings.Action}"
    In project where the component is declared its value is an instance of FacesCtrlHierBinding and in the rest of the projects is of type String with value "Action".
    Once again thank you a lot,
    Bogdan

  • Howto: Iterate ADF BC from a managed bean from the View?

    Hi Everyone,
    I've been trying to iterate a BC ADF object from a managed bean from the view layer. Here is what I have done so far, but I don't seem to get any records:
    In faces-config.xml, I am passing in the BindingContext to the managed bean. (This is a session scoped bean).
    <managed-property>
          <property-name>bindings</property-name>
          <property-class>oracle.adf.model.BindingContext</property-class>
          <value>#{data}</value>
        </managed-property>In the testPageDef.xml I have the executables and bindings setup:
      <executables>
        <iterator id="TestRO1Iterator" RangeSize="-1" Binds="TestRO1"
                  DataControl="ApplicationControlDataControl"/>
      </executables>
      <bindings>
        <table id="TestRO1" IterBinding="TestRO1Iterator">
          <AttrNames>
            <Item Value="C1"/>
            <Item Value="C2"/>
          </AttrNames>
        </table>
    </bindings>In my managed bean, in addition to the accessors for the bindingContext of bindings, I have:
                 BindingContainer bc = getBindings().findBindingContainer("testPageDef");
                 ControlBinding cb = bc.getControlBinding("TestRO1");
                 RangeBinding rb = (RangeBinding)cb;
                 List testList = rb.getRangeSet();
                 Iterator testIter = testList.iterator();
                 int testCount = testList.size();
                 while (testIter.hasNext()) {
                   Map attrs = (Map)testIter.next();
                   System.out.println(attrs.get("C1")+","+attrs.get("C2"));     
                   //Do some fancy stuff here with the values.
                 }However, my testList.size() always returns 0.
    Is this the right method to programatically access the data from the view layer from a managed bean, or have I missed something completely? Are there any working samples that I could take a look at?
    Jdev: 10.1.3.1
    Thanks!
    Kenton

    Hi,
    <managed-property>
    <property-name>bindings</property-name>
    <value>#{bindings}</value>
    </managed-property>
    private BindingContainer bindings= null;
    public void setBindings(BindingContainer bc){
    bindings = bc;
    public BindingContainer getBindingContainer(){
    return bindings;
    DCIteratorBinding dciter = (DCIteratorBinding ) bc.get("TestRO1Iterator");
    RowSetIterator rsi = dciter.getRowSetIterator();
    while (rsi.hasNext()){
    Row rw = (Row) rsi.next();
    //Do some fancy stuff here with the values.
    You find several examples in the developer guide and on the Internet
    Frank

  • Bean datacontrols and managed beans

    Hi,
    When I use bean data controls, my bean from which the datacontrol is created is in session scope. In this case, should I be using another managed bean for the UI purpose or shall I use the "data control bean" ?
    For eg:
    I have a an EmployeeManager which returns a list of employees. Now I created a data control from my EmployeeManager. And I create a table of employees on my jspx. Suppose I want to keep the last selected employee record for some back end processing ( maybe a web service call to get the Employee Salary details) , shall I keep the selected Employee in my EmployeeManager or should I have a managed bean?
    If I keep this in managed bean, again I need it in my EmployeeManager for back end call. Please guide me.
    Thanks,
    Manoj

    Model layer binds presentation layer to business logic and data services and vise versa. In ADF applications the model layer is implemented as ADF DataControls + ADF Bindings. The presentation layer is implemented usually as UI. The business logic and data services may be implemented in various ways (ADF BC, EJB, POJO, Java Beans, Web Services, etc.). See this ADF architecture diagram.
    You should separate these layers from each other. In this way you will be able to replace the implementation of some layer without re-engineering the other ones (for example, to replace the bean-based data services with ADF based ones without re-engineering the user interface).
    Keeping track of the current records is responsibility of the model layer and the business/data services. The JSF managed beans are not a proper place to do it because they are part of the presentation layer. (In theory if you have good application architecture and you replace the implementation of the data service, then you should not be forced to modify the presentation layer too).
    ADF iterator bindings (defined in PageDefs) have a built-in funtionality for keeping track of current rows. In my opinion, they have this functionality regardless of the kind of the data services they are based on, so if you use ADF bindings you should have this functionality out-of-the-box even in case of a bean-based DataControl.

  • Error calling Method on Managed Bean from another Managed Bean

    Hi
    (Jdev 11.1.1.2.0)
    Help please:
    I have a managed bean (page flow scope) which is used by my main page for dynamic region flow navigation:
    *public class RegionNavigationBean implements Serializable{*+
    private String dynamicTaskFlowId = "/WEB-INF/home-task-flow-definition.xml#home-task-flow-definition";+
    *public RegionNavigationBean() {*+
    *public TaskFlowId getDynamicTaskFlowId() {*+
    return TaskFlowId.parse(dynamicTaskFlowId);+
    *public void setDynamicTaskFlowId(String taskFlowId) {*+
    this.dynamicTaskFlowId = taskFlowId;+
    taskFlowId property on main page def is set to +*${pageFlowScope.regionNavigationBean.dynamicTaskFlowId}*+
    In a DB table (i.e. View Object on my model layer) I store a menu ID and a corresponding task_flow_id.
    Then I have created an action listener class (RegionNavigationListener - page flow scope) which I link to my menu items on my main page (action listener property on menu item = +*#{pageFlowScope.regionNavigationAction.processAction}*+ )
    In this action listener (processAction method), I retrieve the row set from the menu VO and find the record which matches my menu ID which caused the action event, thereby retrieving the task_flow_id which must be navigated to.
    I then try to retrieve the instance of the RegionNavigationBean with the following statement: RegionNavigationBean regNav = (RegionNavigationBean)JSFUtils.getManagedBeanValue("regionNavigationBean");+
    This seems to work fine, but as soon as I try and use this I get NullPointerException error, e.g.:
    regNav.setDynamicTaskFlowId(menusRow.gettaskFlowId());+
    or even:
    System.out.println("%%% " + regNav.toString());+
    This is all quite new to me... any help would be appreciated!
    Thanks
    Mario

    Hi Mario,
    I think JSFUtils.getManagedBeanValue(String) has difficult to evaluate the "regionNavigationBean" managed bean.
    What JSFUtils.getManagedBeanValue(String) do is important. I remember that "JSF scoped" bean can be found by JSF style find method, such as requestScope, sessionScope, applicationScope. For a managed bean put in these scope, scope prefix is not needed, for example: using #{beanName} to locate a requestScope bean. The #{requestScope} prefix is not needed.
    But pageFlowScope is different. If a bean is put in the pageFlowScope, you must use #{pageFlowScope.beanName} to locate it.
    Say, ManagedBean is the java class of your manged bean.
    FacesContext ctx = FacesContext.getCurrentInstance();
    Application app = ctx.getApplication();
    ManagedBean mb = (ManagedBean)app.evaluateExpressionGet(ctx, "#{pageFlowScope.managedBeanName}", ManagedBean.class);
    Hope it helps.
    Todd
    Edited by: Todd Bao on Nov 26, 2009 9:58 PM

  • How to access all rows one by one of a ADF table through managed bean

    Hi Experts,
    Hi i am new in ADF.
    Could someone help me for solving the below case?
    Scenario - I have table called Test_T1 which have 4 columns C1,C2,C3,C4. Have created EO,VO and AM for test_t1.
    At the time of ADF page creation i selected the option 'Automatically Exposed UI components in New managed bean' (mynewmanagedbean.java).
    From Data control drag and drop Test_T1 table in the page as a ADF table.
    Set the properties for C1,C2,C3 is read only and C4 is an input text.
    Have add after the table and attathed button action on the managed bean mynewmanagedbean.java.
    At the time of running the page Test_T1 populated with some no. of rows (like 9).
    How can i access all the above rows through pressing the button without selection of any of them.
    Actually i want to print all the table rows in log file at the time of pressing the button.
    Thanks in advance.

    Hi Timo,
    Thanks a lot for your reply.
    I am using the JDeveloper 11.1.2.1.0.
    As previously said I am totally new in this framework. So if you explain the solution given by you then it will be help full for me.
    Don't know r you agree or not for this ?
    When i put your resolution in the command button bean JDeveloper said TestDataRow type not found.
    What will be the type and TestDataRow and what is missing in below code or how i will declare that in below code?
    Also Could please mentioned the missing thing ?
    package createrow.view.pagecreation.bean;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import org.apache.myfaces.trinidad.model.RowKeySet;
    import oracle.adf.model.BindingContext;
    import java.util.Iterator;
    import java.util.List;
    import oracle.adf.model.bean.DCDataRow;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.RowSet;
    import oracle.jbo.RowSetIterator;
    import oracle.jbo.ViewObject;
    public class OrdCreationWithManagedBean {
    public String cb1_action() {
    // Add event code here...
    DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcIteratorBindings =
    bindings.findIteratorBinding("TestOrderItemAllocationVO1Iterator");
    // Get all the rows of a iterator
    Row[] rows = dcIteratorBindings.getAllRowsInRange();
    TestDataRow dataRow = null;
    for (Row row : rows) {
    dataRow = (TestDataRow)((DCDataRow)row).getDataProvider();
    // work with the row...
    return null;
    My page bindings like below
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="11.1.2.60.81"
    id="OrdCreationWithManagedBeanPageDef" Package="createrow.view.pageDefs">
    <parameters/>
    <executables>
    <variableIterator id="variables"/>
    <iterator Binds="TestOrderItemAllocationVO1" RangeSize="25" DataControl="MainAppModuleDataControl"
    id="TestOrderItemAllocationVO1Iterator"/>
    <iterator Binds="TestOrderItemsEOView1" RangeSize="25" DataControl="MainAppModuleDataControl"
    id="TestOrderItemsEOView1Iterator"/>
    </executables>
    <bindings>
    <tree IterBinding="TestOrderItemAllocationVO1Iterator" id="TestOrderItemAllocationVO1">
    <nodeDefinition DefName="createrow.view.TestOrderItemAllocationVO" Name="TestOrderItemAllocationVO10">
    <AttrNames>
    <Item Value="AllocationId"/>
    <Item Value="AlocationSequence"/>
    <Item Value="ProductName"/>
    <Item Value="AllocationPercentage"/>
    </AttrNames>
    </nodeDefinition>
    </tree>
    <tree IterBinding="TestOrderItemsEOView1Iterator" id="TestOrderItemsEOView1">
    <nodeDefinition DefName="createrow.view.TestOrderItemsEOView" Name="TestOrderItemsEOView10">
    <AttrNames>
    <Item Value="OrderId"/>
    <Item Value="AllocationId"/>
    <Item Value="ProductName"/>
    <Item Value="OrderItemsQty"/>
    </AttrNames>
    </nodeDefinition>
    </tree>
    </bindings>
    </pageDefinition>
    Thanks In Advance

  • Can I set the value of a list binding in my managed bean?

    Dear All,
    This is just an exercise for me and I just wanted to experiment on the bindings of ADF for me to understand it further.
    I wanted to create a custom Model Driven LOV with my data control listed below
    Countries
         -CountryId
         -CountryName..but I wanted to display the label similar to this
    1 - USA
    2 - England
    n - France..so I thought of manipulating the select items in a bean
    <af:selectOneChoice id="soc1" value="#{bindings.Countries.inputValue}">
      <f:selectItems value="#{pageFlowScope.MyBean.countries}" id="si1" valuePassThru="true"/>
    </af:selectOneChoice>..and the code similar to this
    public class MyBean{
         public List<SelectItem> getCountries(){
              //countryMap points to accessing the iterator binding
              //BindingsHelper is a utility class that sets the value
              for(...){
                   SelectItem item = new SelectItem();
                   item.setLabel(countryMap.get("CountryId") + " - " + countryMap.get("CountryName"));
                   item.setValue(countryMap.get("CountryId"));
                   list.add(item);
              //set the item to the first row
              BindingsHelper.setExpressionValue("#{bindings.Countries.inputValue}",
                                     list.get(0).getValue());
              return list;
    }...on the last part I wanted to set the value to the first item but I am encountering numberformatexception when setting the list binding.
    I know I can do this declaratively also by removing the unselected item but as I have said I am experimenting on the bindings.
    Is this not possible?
    Thanks.
    JDev 11G PS5

    Hi ,
    I understand that , you want to show select one choice (dropdown) with label (countyid - country name) and value is (countryid).
    and these informnation is coming from ADf Model ( may be a VO).
    in the UI page you used this list is coming from MyBean
    <af:selectOneChoice id="soc1" value="#{bindings.Countries.inputValue}">
    <f:selectItems value="#{pageFlowScope.MyBean.countries}" id="si1" valuePassThru="true"/>
    </af:selectOneChoice>
    so ,
    The Managed Bean code should be ,
    private List<SelectItem> countries;
    ///setter method
    public void setCountries(List<SelectItem> countries) {
    this.countries= countries;
    // getter method
    public List<SelectItem> getQuoteStatusList() {
    quoteStatusList =
    selectItemsForIterator("countriesVOIterator",
    "countryId", "countryName");
    return quoteStatusList;
    public static List<SelectItem> selectItemsForIterator(String iteratorName, String valueAttrName, String displayAttrName) {
    return selectItemsForIterator(findIterator(iteratorName), valueAttrName, displayAttrName);
    public static DCIteratorBinding findIterator(String name) {
    DCIteratorBinding iter = getDCBindingContainer().findIteratorBinding(name);
    if (iter == null) {
    throw new RuntimeException("Iterator '" + name + "' not found");
    return iter;
    public static List<SelectItem> selectItemsForIterator(DCIteratorBinding iter, String valueAttrName, String displayAttrName) {
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r : iter.getAllRowsInRange()) {
    string labelValue = (String)r.getAttribute(valueAttrName) +"-"+ (String)r.getAttribute(displayAttrName);
    selectItems.add(new SelectItem(r.getAttribute(valueAttrName),labelValue ));
    return selectItems;
    this will give you what you except in the ui
    when you try to get the value form that seclecOneChoice value in MyBean what user selects , you can simply get the value of this selectOneChoice.

  • Make information about the current user available in a managed bean

    I've overridden prepareSession in an Application Module (AM) so that when a user logs into my application, it immediately uses the username as a bind variable to execute the query for a View Object (VO) that gets more information about the user, like full name, e-mail address ... This works fine and I'm able to bind the VO to a page and display the information.
    But now I'm beginning to realize that I'm going to need this information about the user throughout the application. Do I have to include an iterator for the user info VO and associated attributeValues on every single pageDef, or is it possible to write a single managed bean that will expose the attributes of the single row of the VO as properties. The application I'm working on now is a "minor" upgrade of a JDeveloper 10.1.3 application, so I need a 10.1.3 solution, but I have a 11.1.2 application in the works that will probably do the same thing.
    Oh, and sorry if this is an FAQ - I'm probably not using good search terms to find solutions that have already been posted.

    Thank you Nick -
    Your code didn't give me exactly the answer I needed, but it pointed me in the right direction. For one thing, I had a version of ADFUtils that didn't have the getApplicationModuleForDataControl method. However I was able to do a Google search and find working code for the missing method. And since the values I need to expose in the managed bean are from the VO, not the AM, I had to go one step further and get a reference to the VO from the AM, and then a reference to the first (and only) row of the VO.
    For anyone else with this question, here's my version of the code:
    public class UserInfo implements Serializable {
        private String eMail;
        private String stateCode;
        private String fullName;
        public UserInfo() {
            AppModuleImpl appModule =
                (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            ContactInfoViewImpl contactInfoVO =
                (ContactInfoViewImpl)appModule.getContactInfoView1();
            contactInfoVO.reset();
            ContactInfoViewRow contactInfo =
                (ContactInfoViewRow)contactInfoVO.first();
            stateCode = contactInfo.getConStCode();
            System.out.println("At construct UserInfo stateCode=" + stateCode);
            eMail = contactInfo.getConInternetAddr();
            System.out.println("At construct UserInfo eMail=" + eMail);
            fullName =
                    contactInfo.getConFname() + " " + (contactInfo.getConMi() != null ?
                                                       contactInfo.getConMi() +
                                                       " " : "") +
                    contactInfo.getConLname();
            System.out.println("At construct UserInfo fullName=" + fullName);
        public String getStateCode() {
            return stateCode;
        public String getEMail() {
            return eMail;
        public String getFullName() {
            return fullName;
    }

  • Managed Bean Help for Definition Help

    I am working on creating Managed Bean Help for Definition Help as described in ‘19.5.3 How to Create Managed Bean Help’ section of the Web User Interface Developer's Guide fpr ADF. Using JDev Version 11.1.2.1.0.
    Thought I had all the artifacts assembled but when I run the log message is: <ELHelpProvider> <_getTranslationMap> ELHelpProvider's helpSourceExpression is null.
    Any suggestions would be greatly appreciated.
    Here is the managed bean:
    public class ELHelpProviderProjRequest extends ELHelpProvider {
        public ELHelpProviderProjRequest() {       
        /* To use the HelpProvider, the EL expression in the helpTopicId attribute must point to a Map, otherwise
           * you will get a coerceToType error. */
        public Map<String, String> getHelpMap()
              Iterator iterator = _HELP_MAP.entrySet().iterator();                
              while(iterator. hasNext()){       
              System.out.println("hash map entry " + iterator.next());
            return _HELP_MAP;
        static private final Map<String, String> _HELP_MAP = new HashMap<String, String>();
            static {
              // each element [put] can be for a separate helpTopicId attribute
              _HELP_MAP.put("MAPHELP_CATEGORY_CAPITAL_DEFINITION", "Map value for credit card definition");
              _HELP_MAP.put("MAPHELP_CATEGORY_OTHER_DEFINITION", "Map value for credit card instructions");         
    }  Here is the adf-setting.xml in Application sources / META-INF:
    <?xml version="1.0" encoding="windows-1252" ?>
    <adf-settings xmlns="http://xmlns.oracle.com/adf/settings" > 
      <adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/settings">
      <help-provider prefix="MAPHELP_">
        <help-provider-class>   
            com.corpnet.abc.util.ELHelpProviderProjRequest
        </help-provider-class>
        <property>
          <property-name>helpSource</property-name>
          <value>#{helpTranslationMap.helpMap}</value>
        </property>
      </help-provider>
    </adf-faces-config> 
    </adf-settings>Here is the faces-config:
    <managed-bean>
        <managed-bean-name>helpTranslationMap</managed-bean-name>
        <managed-bean-class> com.corpnet.abc.util.ELHelpProviderProjRequest </managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>Here is the helpTopicId in the inputText component:
    <af:inputText value="Test" inlineStyle="font-weight: bold;" id="it31" simple="true" helpTopicId="MAPHELP_CATEGORY_CAPITAL" readOnly="true"/>

    Register the managed-bean as a help provider in the adf-settings xml like:
    Example 19-9 Registering a Managed Bean as a Help Provider
    <adf-settings xmlns="http://xmlns.oracle.com/adf/settings">
    <adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/settings">
    <help-provider prefix="MAPHELP_">
    <help-provider-class>
    oracle.adf.view.rich.help.ELHelpProvider
    </help-provider-class>
    <property>
    <property-name>helpSource</property-name>
    <value>#{helpTranslationMap.helpMap}</value>
    </property>
    </help-provider>
    </adf-faces-config>
    </adf-settings>
    As you've pointed out, Review section 19.5.3 for more details -> http://docs.oracle.com/cd/E24382_01/web.1112/e16181/af_message.htm#CHDHIGIA
    You could also investigate use the OHW product available here: http://www.oracle.com/technetwork/developer-tools/help/index-083946.html

  • How to call partial trigger on JSFF component from separate managed bean?

    Guys and Gals,
    Using JDev 11.1.1.2.0. Looked on the forums and google. Initial results aren't so great.
    Is it possible to call a PPR on a JSFF component from a separate managed bean? It seems calling the FacesContext in this instance calls the root JSPX, which only contains one child: the RichDocument.
          UIComponent component =
             FacesContext.getCurrentInstance().getViewRoot().findComponent("pc1:table1");
          if (component != null)
             AdfFacesContext context = AdfFacesContext.getCurrentInstance();
             context.addPartialTarget(component);
          System.out.println(FacesContext.getCurrentInstance().getViewRoot().getChildCount());Returns 1 :(
    Ideas for a workaround?
    Edited by: LovettWB on Nov 17, 2010 3:39 AM
    Edited by: LovettWB on Nov 17, 2010 4:11 AM
    Edited by: LovettWB on Nov 17, 2010 4:12 AM

    Thanks! Joonas, you've been a great help.
    The code on the page you referenced was close, but the code on a page referenced in the user comments was even better:
    http://www.jroller.com/mert/entry/how_to_find_a_uicomponent
    My region is located in a facet, which the page you posted doesn't quite cover, but the page above fixed that. Here's the fix below:
    In Managed Bean
          // search for the region ID (or task flow) in the base page
          UIComponent base = jsfUtils.findComponentInRoot("dynamicRegion");
          // now find component ID from within that region
          UIComponent partTable = jsfUtils.findComponent(base, "partTable");
          // call PPR on your found component
          AdfFacesContext.getCurrentInstance().addPartialTarget(partTable);In JSFUtils utility class
       // used to locate region.  Could also find any component
       // located in the base ViewRoot()
       public static UIComponent findComponentInRoot(String id) {
        UIComponent component = null;
        FacesContext facesContext = FacesContext.getCurrentInstance();
        if (facesContext != null) {
          UIComponent root = facesContext.getViewRoot();
          component = findComponent(root, id);
        return component;
        // Recursive method which finds your component within JSFF
        // regardless of facet or other UIComponents which may have children
    public static UIComponent findComponent(UIComponent base, String id) {
        if (id.equals(base.getId()))
          return base;
        UIComponent kid = null;
        UIComponent result = null;
        Iterator kids = base.getFacetsAndChildren();
        while (kids.hasNext() && (result == null)) {
          kid = (UIComponent) kids.next();
          if (id.equals(kid.getId())) {
            result = kid;
            break;
          result = findComponent(kid, id);
          if (result != null) {
            break;
        return result;
    }Good stuff to know!

  • Call bounded task flow from managed bean

    Hi experts,
    can we call a bounded task flow from a managed bean?
    if yes , please explain.....
    Thankz in advance
    PMS

    Hi john,
    Thankz for ur reply........sorry if im asking stupid questions.
    this is my tree selection handler
    public void treeSelectionHandler(SelectionEvent selectionEvent) {
    RichTree tree1 = (RichTree) selectionEvent.getSource();
    RowKeySet rks2 = selectionEvent.getAddedSet();
    Iterator rksIterator = rks2.iterator();
    if (rksIterator.hasNext())
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeBinding = null;
    treeBinding = (JUCtrlHierBinding) ((CollectionModel)tree1.getValue()).getWrappedData();
    JUCtrlHierNodeBinding nodeBinding = nodeBinding = treeBinding.findNodeByKeyPath(key);
    DCIteratorBinding _treeIteratorBinding = null;
    _treeIteratorBinding = treeBinding.getDCIteratorBinding();
    JUIteratorBinding iterator = nodeBinding.getIteratorBinding();
    String keyStr = nodeBinding.getRowKey().toStringFormat(true);
    iterator.setCurrentRowWithKey(keyStr);
    JUCtrlHierTypeBinding typeBinding = nodeBinding.getHierTypeBinding();
    String targetIteratorSpelString = typeBinding.getTargetIterator();
    if (targetIteratorSpelString.equals("${bindings.Iascat1View1Iterator}"))
    System.out.println("Tree Selected*************"+targetIteratorSpelString);*
    else
    if(targetIteratorSpelString.equals("${bindings.Iascat2View1Iterator}"))
    *System.out.println("Tree Selected**************"+targetIteratorSpelString);*
    else
    *System.out.println("Tree Selected**************"+targetIteratorSpelString);*
    I hav bounded task flow for each iterator for creating new record......i hav to replace code for calling bounded task flow instead of printing statement
    PMS

  • Sharing managed beans

    Ok �. This is driving me nuts. I�m relatively new to JSF (2 week profession &#61514; ), and I may not have grasped the concept of Managed Beans. The problem is detailed below:
    Development Environment:
    WebSphere Studio 1.5.2 � This creates a backing bean for each respective JSP page that is created, including setters and getters for each managed bean. The two backing beans I�ll talk about whilst specifying the problem are stored in session scope.
    The Problem:
    I can�t share data between two pages. On the first page I create managed bean in session scope and make this reusable (let�s say person). On the second page I add the reusable Person bean. The resulting entry in the faces.config file is:
    <managed-bean>
    <managed-bean-name>person</managed-bean-name>
    <managed-bean-class>ibm.wlrs.model.PersonVO</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    Both pages however maintain an independent copy of the managed bean instead of JSF maintaining a shared one. I�ve looked at several documents, and too me it seems as though this bean should be shared between the two pages�� HELP!
    On the first page I create a new Person object with the relevant details. This person is created upon a button click added to the backing beans managed bean.
    //Page 1 add person from button click
    public String doLnkInsertEntryAction() {
    System.out.println("Insert");
         Person p1 = new Person();
         p1.setName("Duncan");
         setPerson(p1);
    System.out.println(getPerson().getName());
    //This prints the person�s name
         return "insert";
    I have also setup a page load event to test that the person object stays in the session
    //Page 1 page load
    public void onPageLoadBegin(FacesContext facescontext) {
         System.out.println(getPerson().getName());
    //Prints the person name that was added during the button click event� on Postback or even after going from page1 � page2 and back again.
    On Page two if I try and access the managedBean contained within the session, the �name� will always print out as null.
    //Page 2 page load
    public void onPageLoadBegin(FacesContext facescontext) {
         System.out.println(getPerson().getName());
    If I add an any information to the managed bean on page two i.e. person.setName(�Another�), this data stays in the session, only for page two though.
    Is this how JSF is supposed to work? I though if a managed bean was stored in the session, the object (and it�s data) should be reusable between pages.
    Sorry for the long post�. I though it would be worth while to try and be as specific as possible.
    Thanks
    Duncan

    And� I still don�t understand why two independent
    copies are kept by the pages�Because YOU create the copy.
    JSF (exactly speaking the default VariableResolver) at first searches for an attribute in
    request scope, then session scope, then application scope with the matching name.
    Only when no attribute is found, it examines faces-config.xml, creates an instance of
    the specified class, and stores the instance in the specified scope.
    It never creates two instances with a same name.
    I.E� On Page 1�. Several Person objects are stored in
    a DataTable. The Vector containing the Person objects
    is a managed bean bound to this data table. Upon a
    button click I require to extract a person from the
    data table and place it into the managed bean session
    scope for person. Humm, I guess you misunderstand what the managed bean is.
    h:dataTable has the "var" attribute which is used to refer each Person object.
    JSF implements the "var" variable as a request scope attribute and re-binds it
    to each Person object in the iteration. So, it is not a managed bean but is simply an attribute.
    The entry of faces-config.xml is not required.
    To know how to pass the selected row data to the next page, please see some
    example using h:dataTable and javax.faces.model.DataModel.

Maybe you are looking for

  • JDBC Sender Adapter - Restrict number of rows fetched, Oracle

    Hi, Is it possible to restrict the number of rows fetched by the JDBC Sender adapter at each run? What would the appropriate Select and Update statements be to make sure a limited number of rows are selected and flagged as processed? We are connectin

  • Can`t install JRE to AMD64

    i`m trying to install: Windows AMD64 Platform - J2SE(TM) Runtime Environment 5.0 Update 4 -Windows AMD64 executable i have amd64 processor + winXP pro (32bit) and get error message: [Computer processor not support this installing packet Take contact

  • Why do we need a bdc program

    Hi, We need batch input programs why? we update current records or add new ones with bdc programs? Thanks.

  • HT204266 Friend Apple ID has taken over my iPad, how to fix this?

    Whenever I want to update an app, it will always show my friends email and request I put in his password. This makes no sense as he has one app on my iPad and nothing else, and yes, I'm singed in as me on the app store. Even in my purchases it asks m

  • Import Powepoint 2007 files

    Is there a way to import Powerpoint 2007 presentations in Keynote? This won't work, even if I save them als PP 2003/97 Thanks for the help! Wim