Iterator VS Rowset

My Jdev version is 11.1.1.6.0
I have exectuded the below code in my manage bean :
DCIteratorBinding VOIter = ADFUtil.findIterator("GEOptionHmNameVO1");
        ViewObjectImpl geOptionHmNameVO = getAm().getGEOptionHmNameVO1();
        geOptionHmNameVO.setApplyViewCriteriaName("GEOptionHmNameVOCriteriaByName");
        geOptionHmNameVO.setNamedWhereClauseParam("bindName", valueChangeEvent.getNewValue());
        geOptionHmNameVO.executeQuery();
     RowSet rowset= geOptionHmNameVO.getRowSet();  //This Row set has value .
RowsetIterator itr =vacancyVOIter.getrRowSetIterator(); //itr has no rows.
When I use rowset to get the value from vo i am getting rows but when i try to get the rows from the iterator which is created in executables section in pageBinding for the VO I find now rows .
Can anyone explain possible reason and what shld be done to get the data from the defined iterator.
Thanks
Soumya

Linda,
I have found out a perfect way for this. Let me know if you find any mistake in this .
In GEOptionHmNameVOImpl class which extends ViewObjectImpl i have written a method
public RowSet executeVCbyName(String name){
        this.setApplyViewCriteriaName("GEOptionHmNameVOCriteriaByName");
       this.setBindName(name);
       this.executeQuery();
return this;
I have exposed this method to my dataControl and added this as methodInvoke in the bindings of the jsff page .
In the manage Bean i have written the following code
BindingContainer bindingContainer = this.getBindings();
OperationBinding operationBinding = bindingContainer.getOperationBinding("executeVCbyName");
Map operationsParamsMap = operationBinding.getParamsMap();
operationsParamsMap.put("name", value);  // passing dynamic value to the parameter
RowSet rowSet = (RowSet)operationBinding.execute();
DCIteratorBinding VOIter = ADFUtil.findIterator("GEOptionHmNameVO1");
RowsetIterator itr =VOIter .getrRowSetIterator(); //itr has no rows.
*Note now I have tested that both rowSet and itr has the rows returned from the execution of VC. I can iterate each row with Row interface class now .

Similar Messages

  • Error in ViewObject's executeQuery causes isExecuted true but rowset empty

    I have an jsp. I call executeQuery implicitly by iterating the rowset, but it fails because of wrong query. Here is call stack:
    void oracle.jbo.server.QueryCollection.executeQuery(java.lang.Object[], int)
              QueryCollection.java:662
         void oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(java.lang.Object, java.lang.Object[], int)
              ViewObjectImpl.java:3049
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean, oracle.jbo.Row[])
              ViewRowSetImpl.java:539
         void oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(oracle.jbo.Row[])
              ViewRowSetImpl.java:586
         void oracle.jbo.server.ViewObjectImpl.executeDetailQuery(oracle.jbo.Row[])
              ViewObjectImpl.java:3013
         void oracle.jbo.server.ViewObjectImpl.executeQuery()
              ViewObjectImpl.java:3000
         int oracle.jbo.html.jsp.datatags.RefreshDataSourceTag.doStartTag()
              RefreshDataSourceTag.java:32
         void _bw3cc__client__details._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              bw3cc_client_details.jsp:8
         void com.orionserver.http.OrionHttpJspPage.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
              OrionHttpJspPage.java:56It forwards to errorpage. When I reload the page, it does not enforce the executeQuery again, because it seems that the query is executed, but rowset has no rows. Is this desired behaviour or a bug?
    Thanks in advance
    Viliam

    Seems like you're getting different AM instances on various requests and in case when the AM is same as the one in which new rowset was created things work fine.
    In JDev 902, BC4J passivation mechanism is not passivating "rowsets" other than the "default" or the ones "Internally created by the framework". You may override passivate/activate VO methods to "programmatically" passivate/activate the fact that the VO has rowsets created in the application and restore the same on activation. The methods to override are ViewObjectImpl.passivateState and ViewObjectImpl.activateState. Alternatively, you may reserve the AM when checking-it in so that on next request you get the same AM, so that no passivation/activation occurs.How do I programmatically set the ViewObjectImpl.passivateState, since I don't see how I can access the VOImpl nor do I see any passivateState method attached to the VO. I thought that by using the following code, I was reserving the AM when checking it in..
    applicationModuleRef.releaseApplicationModule(true, true);
    am I wrong about this?
    In addition, when I set the applicationModuleRef to be able to grab the AM, we're reserving the passivationId from the cookie: cookie.reservePassivationId().

  • How to get selected entity from ADF Table

    I'm using EJB and ADF Faces.
    I have an ADF Table, and when a row is selected I'd like to be able to get the EJB Entity that was selected, is this feasible?
    The reason I would like to do it, is for a Dialog. I have a popup dialog, and in the popup the user can do a search. The results are displayed in the ADF table. When supplying the return value from the dialog:
    AdfFacesContext.getCurrentInstance().returnFromDialog(?, null);
    I would like ? to be the EJB entity representing the row, because I need to return the value of more than one of the columns. Is this not realistic, or should I just add then to a List and pass that back?
    thanks
    R

    Thanks KUBA,
    I hacked some code from the inbuilt JDeveloper Help. Are you saying there is an easier way than this, or did I state the question poorly and you gave an answer to something else? My english is not always perfect.
    This is the code that works for me. (cmdSelect is the submit button on the table)
    public String cmdSelect_action() {
    //Access the tableSelectMany1 table. Note that the table name
    //is taken from the id of the table in the JSF page.
    CoreTable table = this.getUserResultsTable();
    //Obtain a list of all selected rows from the table
    Set rowSet = table.getSelectionState().getKeySet();
    Iterator rowSetIter = rowSet.iterator();
    //Use the declarative method to get the ADF bindings
    BindingContainer bindings = getBindings();
    //Get the object to delete. To do this, you must get the
    //iterator binding for the Products in the page definition file,
    //and cast it to DCIteratorBinding for further processing
    DCIteratorBinding pr_dcib = (DCIteratorBinding)
    bindings.get ("queryUserVFindByFullNameIter");
    //Loop through the set of selected row numbers and delete the
    //equivalent object from the Products collection.
    UserV userV = null;
    while (rowSetIter.hasNext()){
    //get the table row
    Key key = (Key) rowSetIter.next();
    //set the current row in the ADF binding to the same row
    pr_dcib.setCurrentRowWithKey(key.toStringFormat(true));
    //Obtain the Products object to delete
    RowImpl prRow = (RowImpl) pr_dcib.getCurrentRow();
    //using the generated code to execute the declarative method
    userV = (UserV)prRow.getDataProvider();
    break;
    AdfFacesContext.getCurrentInstance().returnFromDialog(userV, null);
    return null;
    }

  • How to read attributes of selected row in table?

    hi,
    can anyone give me a example, how to get value of currently selected row of af:table,in backingbeans? assuming using jdv10g & single selection in table.
    thanks & regards

    in the table selectionlistener
            BindingContainer bindings = getBindingsForDCB();
            RichTable table=table1; 
            DCIteratorBinding outListIter = getBindingsForDCB().findIteratorBinding("yourtableIterator");
            RowKeySet rowSet = table.getSelectedRowKeys();
            Iterator rowKeySetIter = rowSet.iterator();
            while (rowKeySetIter.hasNext()) {
                    List l = (List) rowKeySetIter.next();
                    Key key = (Key)l.get(0);
                    outListIter.setCurrentRowWithKey(key.toStringFormat(true));   
                    Row r = outListIter.getCurrentRow();
          }

  • How can I see changes in table with insertrow();postchanges()without commit

    Hi friends;
    I use jdeveloper 10.1.3.1 with jheadstart 10.1.3.1.
    I create two view object.In the first page I create table with one view object.
    In the second page I create table (with tableselectmany) with other view.
    I select many rows in second page and in the managed bean,
    I insert selectted rows atributes to first pages tables attributes.
    I use this code.
    public String commandbuttonaction(){
    CoreTable table = this.getTable1();
    Set rowSet = table.getSelectionState().getKeySet();
    Iterator rowSetIter = rowSet.iterator();
    BindingContainer bindings = getBindings();
    DCIteratorBinding pr_dcib = (DCIteratorBinding)
    bindings.get("DeptIterator");
    int i=206;
    while (rowSetIter.hasNext()){
    Key key = (Key) rowSetIter.next();
    pr_dcib.setCurrentRowWithKey(key.toStringFormat(true));
    RowImpl prRow = (RowImpl) pr_dcib.getCurrentRow();
    String AM="model.AppModule";
    String CF="AppModuleLocal";
    ApplicationModule empSvc = Configuration.createRootApplicationModule(AM, CF);
    ViewObject emps = empSvc.findViewObject("EmpsView1");
    Row newEmp = emps.createRow();
    newEmp.setAttribute("Manager",new Number(1));
    newEmp.setAttribute("Department",new Number(1));
    newEmp.setAttribute("Depno",new Number(3));
    emps.insertRow(newEmp);
    try {
    newEmp.validate();
    catch (Exception ex) {
    System.out.println("validate catch");
    try {
    empSvc.getTransaction().postChanges();
    catch (Exception ex) {
    System.out.println("post catch");
    Configuration.releaseRootApplicationModule(empSvc,true);
    i=i+1;
    In this code I only postchanges() in first view and dont want to commit.
    But I cant see changes row in the page .If I press save I see transaction completed succesfully message.
    But in database not insertted any rows.
    If I write commit() after postchanges() code I see rows in the table .But I dont want to commit.Only post
    my changes and if necessary I press save button in page.
    How can I see changes in the page without commit???Thanks for all....

    You should NEVER use statements like this in managed beans:
    ApplicationModule empSvc = Configuration.createRootApplicationModule(AM, CF);
    This will create a separate application module instance, not shared by the the web pages. That's why you do not see the changes.
    Instead, you can use the following code:
    ApplicationModule am = (ApplicationModule)JsfUtils.getExpressionValue("#{data.MyAppModuleDataControl.dataProvider}");
    where MyAppModuleDataControl shoud be replaced with the name of your am data control.
    Steven Davelaar,
    JHeadstart Team.

  • Problem with select many rows in table

    1. I have af:table
    2. In my bean I get the selected rows with
    DCIteratorBinding countriesIterator =
    ADFUtils.findIterator("FigureTypesViewIterator");
    RowKeySet rowSet = this.getRichTable().getSelectedRowKeys();
    Iterator rowSetIterator = rowSet.iterator();
    But I get only the last selected row. Any suggestions ?
    <af:table value="#{bindings.FigureTypesView.collectionModel}" var="row"
    rows="#{bindings.FigureTypesView.rangeSize}"
    first="#{bindings.FigureTypesView.rangeStart}"
    emptyText="#{bindings.FigureTypesView.viewable ? 'No rows yet.' : 'Access Denied.'}"
    fetchSize="#{bindings.FigureTypesView.rangeSize}"
    selectedRowKeys="#{bindings.FigureTypesView.collectionModel.selectedRow}"
    selectionListener="#{bindings.FigureTypesView.collectionModel.makeCurrent}"
    rowSelection="multiple"
    binding="#{PeopleSelectManyLOVBean.richTable}">

    Zaro,
    To get a table to work correctly for multiple selection following changes need to be made
    1. Set property 'rowSelection' to multiple.
    2. Remove property 'selectedRowKeys'.
    3. Remove property 'selectedListener'.
    4. Remove property 'selectedState'.
    Only then does the multi select work correctly.
    HTH,
    --AJ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Multiple selection problem in adf

    hi all,
    i have table with multiple selection. i use above code but i read only one record. moreover, i read different record in each selection.
    CoreTable table = this.getTable1();
    Set rowSet = table.getSelectionState().getKeySet();
    Iterator rowSetIter = rowSet.iterator();
    bindings = getBindings();
    DCIteratorBinding pr_dcib = (DCIteratorBinding)bindings.get ("arizagozlemview1Iterator");
    while (rowSetIter.hasNext){
    Key key = (Key) rowSetIter.next();
    String ad=key.toStringFormat(true);
    System.out.println(ad);
    pr_dcib.setCurrentRowWithKey(ad);//
    ViewRowImpl rowImpl = (ViewRowImpl)pr_dcib.getCurrentRow();
    Number a = (Number)rowImpl.getAttribute("ArizaNo");
    System.out.println(a);
    }

    The problem is the position of the command button, the button must be out of the table tags
    <af:commandButton text="commandButton 1"
    binding="#{mybacking.commandButton1}"
    id="commandButton1"
    action="#{mybaking.Button_action}"/>
    <af:table value=...

  • Multiple selection in table not returning all selected rows

    I am unable to obtain multiple selected rows from a table. I only get a single row no matter how many I select.
    I have the following table
    <af:table value="#{bindings.TargetSelectorTargets1.collectionModel}"
    var="row"
    rows="#{bindings.TargetSelectorTargets1.rangeSize}"
    emptyText="#{bindings.TargetSelectorTargets1.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.TargetSelectorTargets1.rangeSize}"
    rowBandingInterval="0"
    filterModel="#{bindings.ImplicitViewCriteriaQuery2.quickQueryDescriptor}"
    queryListener="#{bindings.ImplicitViewCriteriaQuery2.processQuery}"
    filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.TargetSelectorTargets1.collectionModel.selectedRow}"
    selectionListener="#{bindings.TargetSelectorTargets1.collectionModel.makeCurrent}"
    rowSelection="multiple"
    partialTriggers="::qryId1" id="t3"
    styleClass="AFStretchWidth"
    binding="#{testbean.targetselectortable}">
    <af:column sortProperty="Name" filterable="true"
    sortable="true"
    headerText="#{bindings.TargetSelectorTargets1.hints.Name.label}"
    id="c2">
    <af:outputText value="#{row.Name}" id="ot33"/>
    </af:column>
    <af:column sortProperty="Type" filterable="true"
    sortable="true"
    headerText="#{bindings.TargetSelectorTargets1.hints.Type.label}"
    id="c11">
    <af:outputText value="#{row.Type}" id="ot34"/>
    </af:column>
    </af:table>
    and I have the following bean method to get the selected rows
    RowKeySet rks = targetselectortable.getSelectedRowKeys();
    Iterator itr = rks.iterator();
    Object key;
    while(itr.hasNext())
    key = (Object)itr.next(); targetselectortable.setRowKey(key);
    Object o = targetselectortable.getRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) o;
    Row row = rowData.getRow();
    System.out.println(row.getAttribute("Name").toString());
    and I only get one row.
    Note: selectedRowKeys="#{bindings.TargetSelectorTargets1.collectionModel.selectedRow}"
    shows a warning that "reference selectedRow" not found.
    Can I do something to make it work?

    can u change the logic like
    RowKeySet rowSet = targetselectortable.getSelectedRowKeys();
    Iterator rowSetIter = rowSet.iterator();
    > while (rowSetIter.hasNext()) {
    > List l = (List)rowSetIter.next();
    > Key key = (Key)l.get(0);
    >
    FacesContext fc = FacesContext.getCurrentInstance();> BindingContainer bindings =
    > (BindingContainer)fc.getApplication().evaluateExpressionGet(fc,
    > "#{bindings}",
    > BindingContainer.class);
    >
    DCBindingContainer bindings = (DCBindingContainer)bindings ;> DCIteratorBinding iter =
    > bindings.findIteratorBinding("TargetSelectorTargets1Iterator");
    >
    > iter.setCurrentRowWithKey(key.toStringFormat(true));
    > Row r = iter.getCurrentRow();
    > System.out.println(row.getAttribute("Name").toString());
    > }

  • Problem in multiple inserting

    Hello!
    I'm trying to code a multiple inserting to the object.
    I'm building a master-detail page, where Master table is the Order, and the Detail page is the Nomenclature + number of nomenclature position in appropriate order.
    It's very comfortable to add to the order's specification many nomenclature at once. To code this action, I created another page, where a Tree-table element contained all Nomenclature data whith tableSelectMany element. I also created a button which must perform the multiple inserting to OrderDetail table and bind to this one such a code:
    public String saveButton_action() {
    BindingContainer bindings = getBindings();
    Set rowSet = tableInfraction.getSelectionState().getKeySet();
    Iterator rowSetIter = rowSet.iterator();
    DCIteratorBinding nomen =
    (DCIteratorBinding)bindings.get("NomenclatureView1Iterator");
    while (rowSetIter.hasNext()) {
    Key key = (Key)rowSetIter.next();
    nomen.setCurrentRowWithKey(key.toStringFormat(true));
    Long NomenToCreate = (Long)shRow.getAttribute("rn");
    OperationBinding operationBinding =
    bindings.getOperationBinding("createOrderDetail");
    Map params = operationBinding.getParamsMap();
    params.put("nNomen", NomenToCreate);
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    rowSet.clear();
    return "back";
    I supposed to call Nomenclature page from an Orders page, select there necessary nomenclature positions and clicking the button perform action to create a multiple OrderDetail rows.
    But clicking the button returns the next error:
    javax.faces.FacesException: #backing_acts_CreateAudOrderDet.saveButton_action}: javax.faces.el.EvaluationException: java.lang.ClassCastException: java.util.Collections$UnmodifiableRandomAccessList     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)     at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)     at oracle.adf.view.faces.component.UIXCollection.broadcast(UIXCollection.java:94)     at oracle.adf.view.faces.component.UIXTree.broadcast(UIXTree.java:181)     at oracle.adf.view.faces.component.UIXTreeTable.broadcast(UIXTreeTable.java:322)     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)Caused by: javax.faces.el.EvaluationException: java.lang.ClassCastException: java.util.Collections$UnmodifiableRandomAccessList     at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)     ... 30 moreCaused by: java.lang.ClassCastException: java.util.Collections$UnmodifiableRandomAccessList     at oracle.revision.userinterface.backing.acts.CreateOrderDet.saveButton_action(CreateAudOrderDet.java:248)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)     at java.lang.reflect.Method.invoke(Method.java:585)     at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126).
    This error doesn't take place when I use not Tree-table, but a simple table to select nomenclature positions, which I need in.
    Please, give me an advice to solve this problem.

    Hi,
    First of all , dont write database update statements inside LOOP
    SELECT MANDT BUKRS GJAHR HKONT SHKZG PSWBT
           FROM BSEG
           INTO TABLE itab1
      WHERE BUKRS IN PBUKRS AND GJAHR IN PGJAHR AND VALUT IN PVALUT.
    SORT ITAB1 BY HKONT.
    LOOP AT ITAB1.
    INSERT INTO ZTAB21 VALUES itab1.   " should be before loop
    WRITE:/ ITAB1-HKONT,ITAB1-SHKZG,ITAB1-TAMT.
    ENDLOOP.
    For using same itab for direct insert, Custom table ZTAB21 should have field names same as BSEG.
    Else, you have to write as below:
    LOOP AT ITAB1.
    wa_ztab21-tfield1 = itab1-bukrs.
    append wa_ztab21 to i_ztab21.
    WRITE:/ ITAB1-HKONT,ITAB1-SHKZG,ITAB1-TAMT.
    ENDLOOP.
    MODIFY ZTAB21 FROM TABLE i_ztab21.
    Regards,
    Nisha Vengal.

  • How can I programmatically select row to edit in ADF - 11g

    Hello,
    I'm having a table with rowSelection="single" and editingMode="clickToEdit". Currently i'm facing two issues.
    First issue: the first click on a table row makes the row selected, on second click it becomes editable. If I click on another row it gets selected, but previously selected row remains editable. I would like to change this, so when I select another row, the previously selected one to become read-only again. By now, I didn't find any solution to set programmatically the 'editable' state of a row.
    The second issue might be a bug and is related to deleting an editable row. I select a row, click to edit it, and then delete it. The next row get's selected, but clicking on it to edit, has no effect unless I press the 'ESC' select another row before. Does anyone have a tip how to workaround it?
    Thank you very much!
    Eniko

    try adding this method in the table selectionListener.
    public void table1_selectionListener(SelectionEvent selectionEvent) {
        public String getCurrentRow() {
            BindingContainer bindings = getBindingsForDCB();
            RichTable table=table1; 
            DCIteratorBinding outListIter = getBindingsForDCB().findIteratorBinding("outlistOutIterator");
            RowKeySet rowSet = table.getSelectedRowKeys();
            Iterator rowKeySetIter = rowSet.iterator();
            while (rowKeySetIter.hasNext()) {
                    List l = (List) rowKeySetIter.next();
                    Key key = (Key)l.get(0);
                    outListIter.setCurrentRowWithKey(key.toStringFormat(true));   
                    Row r = outListIter.getCurrentRow();
            return null;
        }

  • ADF Faces  - type of key element!

    Does anybody know What type of element that can be get by
    Set rowSet = selectionEvent.getSelectedKeys().getKeySet();
    or
    Set rowSet = treeTableEventType.getSelectionState().getKeySet();
    Iterator rowSetIterator = rowSet.iterator();
    in SelectionListener method

    Dear John,
    I think so
    but I get exception
    SEVERE: java.lang.ClassCastException: java.util.Collections$UnmodifiableRandomAccessList
    javax.faces.el.EvaluationException: java.lang.ClassCastException: java.util.Collections$UnmodifiableRandomAccessList
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
         at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1079)
         at oracle.adf.view.faces.component.UIXTreeTable.broadcast(UIXTreeTable.java:318)
    When when Itry to cast Set element to Key type:
    Key k=(Key)rowSetIterator.next()

  • Accessing Detail Row of secondary Rowset iterator

    Hi,
    Newbie question:
    If I have a parent VO with a child VO -
    And I create a secondary rowset for the parent VO, how do I create a secondary rowset for the child VO so that I can access child rows attributes?
    Thanks
    Kevin

    If you create the Java classes for the master and child vo you can generated accessors to get from the master to the child vo.
    You then use this accessor to get the child record set.
    You find this option if you open the view link. It's the checkbox 'create accessor in view object'.
    Timo

  • How to return current value in iterator

    hi i have the following code when i iterator am always geting the same value,it display first value from the lov which is from the previous page.this is how am displaying the value i select value from lov and navigate to next page when am in the next page i must display value based on the lov selection,now i what to iterator that value organisation name,am always geting this value when iterating am not able to get the current value organisationname Botha Inc this value is the first value in my previous page lov
        public String getorgname(){
            String orgname = null;
           // DCIteratorBinding it = ADFUtils.findIterator("UpdUamOrganisation1Iterator");
            DCBindingContainer bindings1 =
                              (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();       
            // DCIteratorBinding it0 = ADFUtils.findIterator("UpdUamOrganisation1Iterator");
            DCIteratorBinding it  = bindings1.findIteratorBinding("UpdUamOrganisation1Iterator");
            RowSetIterator rsi = it.getRowSetIterator();   
            Row rw =   rsi.first();
        orgname = (String)rw.getAttribute("Organisationname");
            System.out.append("organisationname " + orgname);
            return orgname;
    my log error is
    <DCIteratorBinding> <releaseDataInternal> [4213] Releasing iterator binding:listIter
    <DCIteratorBinding> <releaseDataInternal> [4214] Releasing iterator binding:listIter
    <DCIteratorBinding> <releaseDataInternal> [4215] Releasing iterator binding:listIter
    <DCIteratorBinding> <releaseDataInternal> [4216] Releasing iterator binding:listIter
    <ViewRowSetImpl> <execute> [4217] UpdResPerson1 ViewRowSetImpl.execute caused params to be "un"changed
    <ViewRowSetImpl> <initQueryCollection> [4218] Carrying over CappedRowCount:-1for ViewRowSet:UpdResPerson1
    <QueryCollection> <createColumnList> [4219] Column count: 11
    <ViewRowSetImpl> <execute> [4220] executeQueryForCollection ViewObject:UpdResPerson1, RowSet:UpdResPerson1
    <ADFLogger> <begin> Execute query
    <ViewObjectImpl> <buildQuery> [4221] UpdResPerson1>#q old SQLStmtBufLen: 654, actual=624, storing=654
    <ViewObjectImpl> <buildQuery> [4222] SELECT UamCompanyofficerdetails.ACCOUNTINGOFFICER,         UamCompanyofficerdetails.CONTACTNUMBER,         UamCompanyofficerdetails.DATE_CREATED,         UamCompanyofficerdetails.EMAILADDRESS,         UamCompanyofficerdetails.IDENTITYNUMBER,         UamCompanyofficerdetails.NAME,         UamCompanyofficerdetails.OFFICERID,         UamCompanyofficerdetails.ORGANISATIONID,         UamCompanyofficerdetails.OWNERSHIP,         UamCompanyofficerdetails.STATUS,         UamCompanyofficerdetails.SURNAME FROM UAM_COMPANYOFFICERDETAILS UamCompanyofficerdetails WHERE UamCompanyofficerdetails.ORGANISATIONID = :Bind_Organisationid
    <ViewObjectImpl> <getStatementFromCache> [4223] ViewObject: [UpdOrgDetails.UpdResPerson]UpdAppModule.UpdResPerson1 Reusing defined prepared Statement
    <ViewObjectImpl> <bindParametersForCollection> [4224] Bind params for ViewObject: [UpdOrgDetails.UpdResPerson]UpdAppModule.UpdResPerson1
    <OracleSQLBuilderImpl> <bindParamValue> [4225] Binding param "Bind_Organisationid": 341
    <ADFLogger> <addContextData> Execute query
    <ADFLogger> <addContextData> Execute query
    just executed query for collection..
    <ViewRowSetImpl> <setWhereClauseParamsInternal> [4226] UpdResPerson1 ViewRowSetImpl.setWhereClauseParams caused params changed
    <ADFLogger> <begin> Estimated row count
    <ViewObjectImpl> <buildQuery> [4227] UpdResPerson1>#q old SQLStmtBufLen: 654, actual=624, storing=654
    <ViewObjectImpl> <buildQuery> [4228] SELECT UamCompanyofficerdetails.ACCOUNTINGOFFICER,         UamCompanyofficerdetails.CONTACTNUMBER,         UamCompanyofficerdetails.DATE_CREATED,         UamCompanyofficerdetails.EMAILADDRESS,         UamCompanyofficerdetails.IDENTITYNUMBER,         UamCompanyofficerdetails.NAME,         UamCompanyofficerdetails.OFFICERID,         UamCompanyofficerdetails.ORGANISATIONID,         UamCompanyofficerdetails.OWNERSHIP,         UamCompanyofficerdetails.STATUS,         UamCompanyofficerdetails.SURNAME FROM UAM_COMPANYOFFICERDETAILS UamCompanyofficerdetails WHERE UamCompanyofficerdetails.ORGANISATIONID = :Bind_Organisationid
    <ViewObjectImpl> <getQueryHitCount> [4229] Estimated Row Count for ViewObject: [UpdOrgDetails.UpdResPerson]UpdAppModule.UpdResPerson1, Query Statement:
    <ViewObjectImpl> <getQueryHitCount> [4230] "SELECT count(1) FROM (SELECT UamCompanyofficerdetails.ACCOUNTINGOFFICER,         UamCompanyofficerdetails.CONTACTNUMBER,         UamCompanyofficerdetails.DATE_CREATED,         UamCompanyofficerdetails.EMAILADDRESS,         UamCompanyofficerdetails.IDENTITYNUMBER,         UamCompanyofficerdetails.NAME,         UamCompanyofficerdetails.OFFICERID,         UamCompanyofficerdetails.ORGANISATIONID,         UamCompanyofficerdetails.OWNERSHIP,         UamCompanyofficerdetails.STATUS,         UamCompanyofficerdetails.SURNAME FROM UAM_COMPANYOFFICERDETAILS UamCompanyofficerdetails WHERE UamCompanyofficerdetails.ORGANISATIONID = :Bind_Organisationid) "
    <ViewObjectImpl> <getQueryHitCount> [4231] Bind params for ViewObject.getQueryHitCount: UpdResPerson1
    <ADFLogger> <addContextData> Estimated row count
    <OracleSQLBuilderImpl> <bindParamValue> [4232] Binding param "Bind_Organisationid": 341
    <ViewObjectImpl> <getQueryHitCount> [4233] ViewObject: [UpdOrgDetails.UpdResPerson]UpdAppModule.UpdResPerson1 Estimated Row Count: 1
    <ADFLogger> <addContextData> Estimated row count
    Source breakpoint occurred at line 1532 of OrgDetails.java.
    organisationname Botha Incam in jdeveloper 11.1.1.6.0
    Edited by: adf009 on 2013/03/15 12:09 PM

    i change the code to this
               public String getorgname(){
            String orgname = null;
           // DCIteratorBinding it = ADFUtils.findIterator("UpdUamOrganisation1Iterator");
            DCBindingContainer bindings1 =
                              (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();       
            // DCIteratorBinding it0 = ADFUtils.findIterator("UpdUamOrganisation1Iterator");
            DCIteratorBinding it  = bindings1.findIteratorBinding("UpdUamOrganisation1Iterator");
            RowSetIterator rsi = it.getRowSetIterator();   
            Row r = rsi.getCurrentRow();
        orgname = (String)r.getAttribute("Organisationname");
        System.out.append("organisationname " + orgname);
            return orgname;
    am still geting the first value from lov when i iterator i what to see the current value selected,i have put the inputtext with the organisation name it always show the first value it does not change when i make selection in my lov i even put the partial trigger but does not change based on lov selection
    my jsff page is
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core">
      <af:panelSplitter id="ps1" orientation="vertical" splitterPosition="148">
        <f:facet name="first"/>
        <f:facet name="second">
          <af:panelStretchLayout id="psl1" startWidth="126px" endWidth="124px">
            <f:facet name="bottom"/>
            <f:facet name="center">
              <af:panelStretchLayout id="psl2" endWidth="137px" startWidth="220px">
                <f:facet name="center">
                  <af:panelGroupLayout id="pgl1" layout="vertical" valign="middle"
                                       halign="center">
                    <af:panelStretchLayout id="psl3"
                                           inlineStyle="width:732px; height:340px;"
                                           bottomHeight="100px">
                      <f:facet name="bottom">
                        <af:panelGroupLayout id="pgl2" layout="vertical"
                                             valign="middle" halign="center">
                          <af:panelHeader text="Select Organisation To Update" id="ph1"
                                          inlineStyle="border-style:ridge; border-color:Blue; height:57px;">
                            <f:facet name="context">
                              <af:group id="g2">
                                <af:toolbar id="t1">
                                  <af:selectOneChoice value="#{bindings.Orgid1.inputValue}"
                                                      required="#{bindings.Organisationid.hints.mandatory}"
                                                      id="soc1" autoSubmit="true"
                                                      valuePassThru="true">
                                    <f:selectItems value="#{bindings.Organisationid.items}"
                                                   id="si1"/>
                                  </af:selectOneChoice>
                                </af:toolbar>
                                <af:inputText label="Label 1" id="it2"
                                              value="#{bindings.Organisationname.inputValue}"
                                              partialTriggers="soc1"/>
                              </af:group>
                            </f:facet>
                            <f:facet name="menuBar"/>
                            <f:facet name="toolbar">
                              <af:group id="g1">
                                <af:toolbar id="t2">
                                  <af:commandButton
                                                    text="UpdateOrganisation"
                                                    disabled="#{!bindings.setCurrentRowWithKeyValue.enabled}"
                                                    id="cb1"
                                                    action="#{pageFlowScope.addMember.showSelectedOrg}"/>
                                </af:toolbar>
                              </af:group>
                            </f:facet>
                            <f:facet name="legend"/>
                            <f:facet name="info"/>
                          </af:panelHeader>
                          <af:inputText label="Selectedorg" id="it1"
                                        value="#{bindings.Orgid1.inputValue}"
                                        partialTriggers="soc1" visible="false"/>
                        </af:panelGroupLayout>
                      </f:facet>
                      <f:facet name="start"/>
                      <f:facet name="end"/>
                      <f:facet name="top"/>
                    </af:panelStretchLayout>
                  </af:panelGroupLayout>
                </f:facet>
                <f:facet name="top"/>
              </af:panelStretchLayout>
            </f:facet>
            <f:facet name="start"/>
            <f:facet name="end"/>
            <f:facet name="top"/>
          </af:panelStretchLayout>
        </f:facet>
      </af:panelSplitter>
    </jsp:root>
    the page def is
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
                    version="11.1.1.61.92" id="SelectOrgPageDef"
                    Package="uam.view.pageDefs">
      <parameters/>
      <executables>
        <variableIterator id="variables">
          <variable Name="Orgid" Type="java.lang.Integer"/>
          <variable Name="orgid" Type="java.lang.Integer"/>
        </variableIterator>
        <iterator Binds="UpdUamOrganisationLov" RangeSize="-1"
                  DataControl="UpdAppModuleDataControl"
                  id="UpdUamOrganisationLovIterator"/>
        <iterator Binds="UpdUamOrganisation1" RangeSize="25"
                  DataControl="UpdAppModuleDataControl"
                  id="UpdUamOrganisation1Iterator"/>
      </executables>
      <bindings>
        <attributeValues IterBinding="variables" id="Orgid1"
                         ChangeEventPolicy="push">
          <AttrNames>
            <Item Value="Orgid"/>
          </AttrNames>
        </attributeValues>
        <list IterBinding="variables" id="Organisationid"
              DTSupportsMRU="true" StaticList="false"
              ListIter="UpdUamOrganisationLovIterator">
          <AttrNames>
            <Item Value="Orgid"/>
          </AttrNames>
          <ListAttrNames>
            <Item Value="Organisationid"/>
          </ListAttrNames>
          <ListDisplayAttrNames>
            <Item Value="Organisationname"/>
          </ListDisplayAttrNames>
        </list>
        <action IterBinding="UpdUamOrganisation1Iterator"
                id="setCurrentRowWithKeyValue" RequiresUpdateModel="false"
                Action="setCurrentRowWithKeyValue">
          <NamedData NDName="rowKey" NDType="java.lang.String"/>
        </action>
        <attributeValues IterBinding="UpdUamOrganisation1Iterator"
                         id="Organisationname">
          <AttrNames>
            <Item Value="Organisationname"/>
          </AttrNames>
        </attributeValues>
      </bindings>
    </pageDefinition>Edited by: adf009 on 2013/03/15 1:19 PM
    Edited by: adf009 on 2013/03/15 1:23 PM
    Edited by: adf009 on 2013/03/15 1:23 PM
    Edited by: adf009 on 2013/03/15 1:29 PM

  • 10.1.3.4.0 : iterator mode : RowIterator.ITER_MODE_LAST_PAGE_FULL

    hi
    The ADF Developer's Guide For Forms/4GL Developers 10g Release 3 (10.1.3.0) section "27.1.4 Presenting and Scrolling Data a Page at a Time Using the Range" ...
    at http://download.oracle.com/docs/cd/B32110_01/web.1013/b25947/bcadvvo.htm#sthref2557
    ... documents two iterator mode flags.
    The first is ITER_MODE_LAST_PAGE_PARTIAL documented as "the style that works best for web applications ".
    The second is ITER_MODE_LAST_PAGE_FULL which turns out the be effectively the default iterator mode value, while the last page is not full.
    Please consider this example application created using JDeveloper 10.1.3.4.0
    at http://www.consideringred.com/files/oracle/2010/IterModeLastPageFull10gApp-v0.01.zip
    It has a simple View Object dropped on a JSF page as a read-only table. It also has a managed-bean that allows to show iterator mode information on the page.
    See the screencast at http://screencast.com/t/qm6flt7asYA
    questions:
    - (q1) Is it intended behaviour to have iterator mode ITER_MODE_LAST_PAGE_FULL while the last page is not full?
    - (q2) How should this iterator mode be configured, and is this possible declarative?
    - (q3) Is it possible to have the "last page full" when navigating ranges of rows using the af:table component (maybe using a configuration unrelated to iterator mode)?
    many thanks
    Jan Vervecken

    Thanks for your reply Frank.
    ... So this seems to be a bug in the behavior. I asked Steve if he would consider this to be a bug and am waiting for his response ...Thank you, I am looking forward to Steve's feedback.
    ... The place to set the declarative setting is on the "Tuning" panel of the VO. ". See the "Fill Last Page of Rows when Paging Through Rowset" checkbox.If I uncheck the "Fill Last Page of Rows when Paging through Rowset" checkbox, as in the modified example application ...
    at http://www.consideringred.com/files/oracle/2010/IterModeLastPageFull10gApp-v0.02.zip
    ... this is reflected on the page, showing
    r_adfHelper.iterModeInfo['EmployeesLimitedVOVIIterator']  ITER_MODE_LAST_PAGE_PARTIAL (0)... instead of ...
    r_adfHelper.iterModeInfo['EmployeesLimitedVOVIIterator']  ITER_MODE_LAST_PAGE_FULL (1) ... but the behaviour of the af:table component has not changed, see also the screenshot in IterModeLastPageFull10gApp-v0.01-v0.02.png.
    - about (q3): Any thoughts on other (configuration) options that could cause "last page full" behaviour in the af:table component?
    regards
    Jan

  • How to get specific rows from the vo or Iterator in the backing bean?

    Hi,
    I have to get the specific number of rows from iterator in the backing bean. means i want to get the records from the VO or Iterator only from 5 th record to 10th record its like rownum in SQL.
    We can use rownum in VO sql query. but there would be a performance issue with that ...
    SO i am trying to get the rows from ADF Iterator once we fetch from DB.
    Is it possible to do that ?
    Do we have any way to set the pointer to the VO/Iterator like setFirst() and after that setMaxResult to retrun the rows between first and maxresult..
    Thanks

    If this is for pagination, then af:table offers pagination by design when you set accessmode=RangePaging or RangePagingIncremental in VO. Paginated queries are fired when scroll down in the table. Explore this option before you try out any custom solution
    To answer the question,
    Note: same logic i have implpemented ADF with EJB ..In EJB Query class we have setFirst(int) and setMaxResult(int) methods...simply i did setFirst(30) and setMaxResult(10)..It worked fine...Theoretically speaking the same can be achieved by setting setRangeStart() on the viewobject(which in turn sets to the default rowset) and by setting max fetch size on VO + accessmode=RangePaging. However when you use table with ADF binding, these will be overridden by the binding layer. If you are not using ADF binding, then the above is same as what you did for JPA entity. Other option is, you build expert mode VO with rownum for this special case, which will work if you dont need to set accessmode=RangePaging for VO.

Maybe you are looking for