Select the current row

hi.,
I am using jdev 11.1.5
can any would please tell me how to select the current row in a table and perform operations in it.,
My Scenario:
I had created a table.,
If the user clicks the button named post it must check the attribute [
Year] and the Status must be updated to all the year
For eg;
St Year
N 201011
N 201112
if the user clicks the button The st attribute should be updated with corresponding Year
so that the N must be updated to P with the year 201011 now my output should be
st Year
P 201011
N 201112
any one can pls help me

Hi..
You can try this using In built Bindings.For that Table need row selection single and need form using same VO.for update drag Commit operation as a button to form.
http://www.mandsconsulting.com/adf-table-row-selection-event-update-form

Similar Messages

  • Select the current row in read only querry VO

    Hi.,
    I am using jdev 11.1.1.5
    I had created a Finyear EO with corresponding VO
    I had also created a read only querry VO [PostdGLhdlnVO]
    I had created a viewlink between FinyearVO and PostdGlhdlnVO with following conditions
    FinyearVO.bu = PostdGLhdlnVO.bu
    FinyearVO.year = PostdGLhdlnVO.year
    I need to select the current row and print that row using println statement. as i am using readonly querry while i drag and drop the PostdGLhdlnVO i cant able to select the current line (i.e., when user clicks the current row)
    My scenario:
    I need to create a non database checkbox for every row in that table [PostdGLhdlnVO] which will get the current row
    can anyone help me to create a nondatabase checkbox for that table

    Try,
    This may help:
    Re: ADF Table Multiple row selection by Managed Bean-Prasad

  • How to Select the Current Row When Using af:iterator?

    Hello all,
    I encounter the following problem when using af:iterator to display data from
    a View Object:
    When trying to display the content of a row via a popup, only the first row is
    returned no matter which row is selected. So a selection of the current row
    should exist or some other method which should allow the access to the
    current row.
    The af:table has a selectionListener attribute which permit to achieve this.
    Does anyone know about some similar attribute or some method for
    selecting the current row when the af:iterator is used?
    Thank you,
    Mirela

    I would be interested in the answer to this basic question as well. I cannot get the selected row value of an attribute in an iterator for a view if I simply set-up a attribute binding to the iterator. It seems that this should be possible. I've had no other option but to obtain the current row and the related attributes programmatically. This works fine, but if there is a more elegant option, then I'd certainly like to use it.
              <af:table value="#{bindings.CompaniesView1.collectionModel}"
                            var="row"
                            rows="#{bindings.CompaniesView1.rangeSize}"
                            emptyText="#{bindings.CompaniesView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                            fetchSize="#{bindings.CompaniesView1.rangeSize}"
                            selectedRowKeys="#{bindings.CompaniesView1.collectionModel.selectedRow}"
                            rowBandingInterval="0" id="tCompanies"
                            summary="Companies"
                            width="100%"
                            rowSelection="single"
                            binding="#{CompanyBackingBean.companiesTable}">Page Def:
        <attributeValues IterBinding="CompaniesView1Iterator" id="Id">
          <AttrNames>
            <Item Value="Id"/>
          </AttrNames>
        </attributeValues>I should be able to get the Id attribute value of the current selected row using "#{bindings.Id}", right? Well, it doesn't work for me. Any ideas?
    Thanks

  • Select the created Row

    Hello,
    I have a big problem, I hope someone can help me.
    I create a new Row with the code
    Row r = myVo.createRow(); And set values with
    r.setAttribute("attr", attrValue);How can I select the current row in this view Object ??
    Thanks in advance

    Dear Rahul,
    Also if you are getting the PDF from the attachments from the services for object, then you can use the below class and FM
    cl_binary_relation=>read_links             "<----Get the attachemnts
    SO_OBJECT_READ                              "<----Get details about attachments
    SO_DOCUMENTS_MANAGER              "<----Display the attachment
    Hope this helps you.
    Regards,
    Sachinkumar Mehta

  • Add radioButton to select the particular Row

    Hello
    Team
    I have one af:table componant i want to give the radio button to a row for select the particular row...
    this functionality bydefault added in 10g but..now i am working in 11g,how can i achive this functionality

    Hi,
    this is tricky because it involves manual coding. You would need to add a radio button. You would use
    http://adfui.us.oracle.com/projects/adf.faces/multiproject/adf-richclient-api/tagdoc/af_selectBooleanRadio.html
    in an extra column and define the group attribute so all rows participate in a single select case. The, when you select a group you need to fire a change event that allows you to determine which radio button is clicked. Based on this information you select the current row in the table. I didn't code this, but this is how I would do it. As said, gows with some coding especially when you nedd to synchronize the radio button with the selction users do by directly clicking into the table
    Frank

  • How to handle the current row with radio button selection???

    Hi Everyone,
    I have one ADF page with one table and one "Find" button.
    I have created one new attribute with VARCHAR2(1) in the VO and dragged that attribute as first column in the table. And changed that first column to Radio Button to select only one row at a time.
    Upon clicking on the "Find" button i need to get the values of current selected row.
    How can i get the values of selected row?
    What code should i write to get the values of selected row in Method Binding of "Find" button?
    Any suggestions will be really useful.
    Thanks.

    Hello Kumar,
    I have some comments on your case.
    >
    I have created one new attribute with VARCHAR2(1) in the VO
    >
    1- You should create this attribute in the Entity object and then add it to the view object.
    2- Do you need that only one radio button is set at a time for all rows ? If yes then you need to handle the case when the user set more than one row and clear the value of the attribute for all other rows.
    >
    How can i get all the values of current row in backing bean method(method binding of Find method)?
    can u plz provide me the code for that?
    >
    If you mean by the current row is that the row with its value of the selected attribute is set (the radio button is set for that row), then you can write a method in the viewObjectImpl class and expose it to client interface and call it from your bean.
    here is an example based in Department table in HR schema.
    //This method is written in DepartmentsViewImpl   
    public Row getSelectedRadioRow(){
                //create a second row set to not impact the row set used in ADF
                RowSet duplicateRowSet = this.createRowSet("duplicateRowSet");
                //get the current row of the table to set it back after re-executing the VO
                DepartmentsViewRowImpl currentRow = (DepartmentsViewRowImpl)this.getCurrentRow();
                Row[] filteredRows = duplicateRowSet.getFilteredRows("IsSelected", "1");
                DepartmentsViewRowImpl row=null;
                if(filteredRows.length>0){
                    row = (DepartmentsViewRowImpl)filteredRows[0];
                    System.out.println("Department Name " + row.getDepartmentName());              
                this.setCurrentRow(currentRow);
                duplicateRowSet.closeRowSet();
                return row;           
            }

  • Get the icon for the current row selected

    Hi !!
    I am using jdeveloper 11.1.1.5
    I had dragged and dropped my ApplBusFunVO as a af:tree
    My Output will look like this
    Supplier Balance
    Supplier Document Details
    Purchase order
    Purchase ReceiptsMy af:tree doesnt contains the Parent
    My Scenario:
    When my user clicks the current node of the tree!! an icon should appear before the current node is selected
    For Eg: If my user clicks the Purchase Order then my output should like this
    Supplier Balance
    Supplier Document Details
    ==>Purchase order
    Purchase ReceiptsThe Symbol ==> Represent the icon! that appears before the purchase order!!

    Hi
    <af:tree value="#{bindings.SalesPeople.treeModel}" var="node"
              selectionListener="#{bindings.SalesPeople.treeModel.makeCurrent}"
              rowSelection="single" id="t4" fetchSize="35">
              <f:facet name="nodeStamp">
                 <af:group>
                      <af:image id="cl3" source="#{reference_to_image_url}"
                      rendered="#{check_if_current_row}"/>
                      <af:outputText id="ot2" value="#{node}"/>
                 </af:group>
       </f:facet>http://docs.oracle.com/cd/E23943_01/apirefs.1111/e12419/tagdoc/af_image.html
    As mentioned in a previous answer to this very same question, the tree is a stamped component which means that you need to partially refresh the tree component to show the icon. You can us the selectionListener (override the current setting to use a managed bean setting the current row - calling the same EL) to determine the new selected row key and then use the rendered option to determine (using a managed bean reference) if the current rendered node (#{node} is accessible from a managed bean at render time) is the selected node.
    The side effect is that upon tree node selection the tree will "flicker"
    Frank

  • Maintain the current row position of a table after refresh.

    Hi,
    I use a poll to refresh tables continuously. when a table is refreshed, the current referring row is reset.
    To maintain the current row position after a refresh I use the following poll method.
    public void refreshTableT1(PollEvent pollEvent) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding dcb = fctx.getApplication().createValueBinding("#{bindings}");
    DCBindingContainer bindings1 = (DCBindingContainer) dcb.getValue(fctx);
    DCIteratorBinding dciter = bindings1.findIteratorBinding("<VOIterator>");
    if(dciter!=null){
    if(dciter.getCurrentRow()!=null){   
    Key current_row_key = dciter.getCurrentRow().getKey();
    dciter.executeQuery();
    if(current_row_key!=null){
    try{
    dciter.setCurrentRowWithKey(current_row_key.toStringFormat(true));
    }catch(Exception ex) {
    System.out.println("Exception in current_row_key");
    }This works for normal tables well. But when I use it to master-detail tables (pair of tables) it does not.
    At the master-detail tables, before the first data fetch, it works well. if we go below the first data fetch, it sets the current row into another position.
    how can I overcome this...??
    Thanks,
    Dinuka.

    Hi Mr.Frank,
    I have an association in two VOs.
    for example: There are 2 tables called Emp and Dept. Every Department has Employees. so there is an association (both tables have a common column). Master table is the Dept table. when you click on one record of the Dept table Detail table will show the details of the employees belongs to that selected department. That's what I referred as master-detail tables. first one is master table; second one is detail table.
    When the web page loads all the table data is not fetched from the db (it will depend on the fetch size). when we scroll down the table data fetch happens again and again.
    think my data fetch size is 25 rows per time.
    Suppose we use mine poll method and think I have clicked on the 20 ^th^ row of table1(master table). then the table2 will display details belongs to selected department. that is OK even after refresh. that works well.
    when I go to 30 ^th^ row data fetch will happen (my fetch size = 25)
    when I click on the 30 ^th^ row of the table1(master table), table2 will display details belongs to selected department. but after the poll method is called the selected row at the table1 disappears and is set to another position. now the 30 ^th^ row is not in the 30 ^th^ position. but it is the selected row and table2 displays correct details.
    I think you have got the problem now. :D
    Thanks a lot.
    Dinuka.

  • Issue in finding the current row

    I am rendering rows of a VO using an iterator component. One of the component I am rendering is a declarative component created by me.
    In this component there is a clickable link on which i can write any method to achieve desired functionality.
    Since, iterator is used so the current row is set to the last row. Now on clicking the link in the declarative component i need to do some operation based on the current row (pk of that row). So, how to find the current row id?
    Note: If it would be a simple adf component like a commandLink i could have inserted a setServerListener inside it and could have put the id in to requestScope to access it. But as this is the declarative component in which i cannot create a serverListener so I am looking for some other solution.

    Hi john,
    My table have the selection listener.
    Thanks in advance

  • Updating the current row in vo which is bind to af:table.

    Dear all.
    I have created af table by dragging datacontrol on page.. i also have a form and onclick of button i want to update the current selected row in table..
    I am getting the current row properly but when i am trying to update the row.. it gives me following exception.
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Failed to lock the record, another user holds the lock.
    oracle.jbo.AlreadyLockedException: JBO-26030: Failed to lock the record, another user holds the lock.
    Following is my update code.
    public void update(){
    //BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Create").execute();
    BindingContext bc = BindingContext.getCurrent();
    JUApplication japp =
    (JUApplication)bc.getCurrentBindingsEntry().get("Entries_AMDataControl");
    Entries_AMImpl ampl = (Entries_AMImpl)japp.getApplicationModule();
    ViewObjectImpl vo=ampl.getEntries_VO1();
    Entries_VORowImpl row=(Entries_VORowImpl)vo.getCurrentRow();
    row.setSubject(subject);
    ClobDomain c=new ClobDomain(toXML().toString());
    row.setXmlcontent(c);
    row.setDescription("");
    //vo.setCurrentRow(row);
    //vo.executeQuery();
    //BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Execute").execute();
    BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit").execute();
    So please can anyone there tell me how can solve this problem.
    Thanks,
    Regards
    jdev version 11.1.1.4.0

    Hi Frank
    in your AM configuration, set the locking behavior to optimisticIts already optimistic.
    is bad coding practice. You should perform updates through teh ADF binding layer and not directlxy against the Application Module Impl class. You can get the >current row from the iterator the table is bound to and set the attributes on itI changed my code to following
    RowKeySet rs = getCalcTable().getSelectedRowKeys();
    Iterator it = rs.iterator();
    DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding empIter =
    bindings.findIteratorBinding("Entries_VO1Iterator");
    StringBuilder sb = new StringBuilder();
    RowSetIterator empRSIter = empIter.getRowSetIterator();
    Row currentRow = null;
    while (it.hasNext()) {
    Key key = (Key)((List)it.next()).get(0);
    currentRow = empRSIter.getRow(key);
    break;
    Entries_VORowImpl row=(Entries_VORowImpl)currentRow;
    row.setSubject(subject);
    ClobDomain c=new ClobDomain(toXML().toString());
    row.setXmlcontent(c);
    row.setDescription("");
    BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit").execute();
    But it still gives me same error.
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Failed to lock the record, another user holds the lock.
    oracle.jbo.AlreadyLockedException: JBO-26030: Failed to lock the record, another user holds the lock.
    Any suggestion appreciated..
    Thanks
    Regards.

  • Is there a way to make the current row not editable

    Hi, I'm using JDev 11.1.1.2
    In my usecase I have a Form , navigateable with next/previous , and for every row a I have a calculation which makes the row editable or not.
    For now I made it with disabled property on every input component set to some bean property which is calculated every time.
    My question is if there is some general way to make an Entity not updateable ?
    I tried with doDML() ... but the problem there is that this method is not called when switching the current row but rather when commiting. So the user can modified several rows and when pressing commit it will prevent some of the to be committed which would be confusing.
    Is there a method in the ViewObject that i can overwrite which is called every time the current row is changed? So I can see if the row was modified or not.
    Thanks, agruev

    Yes, there is always isAttributeUpdateable() in the ViewRowImpl, which you can override and enable/disable your attributes based on an enabling/disabling condition.
    Here is an example:
    public boolean isAttributeUpdateable(int i) {
    boolean updateable = false; /disable by default all arguments
    // enable, if your condition is met
    if ( meets_your_condition )
    updateable = super.isAttributeUpdateable(i); // let the framework decide based on your declarative settings
    return updateable; // return true/false indicator
    Nick

  • Fetch the current row in executeQueryForCollection

    Here is what I have:
    Master-detail-detail
    VO1
    --VO2 via VO1VO2Link
    -----VO3 via VO2VO3Link
    I am editing or creating new record in VO3 (Say UIX input form) but want to implement 'rollback' button and go back to the CURRENT row in VO2 (WITHOUT RESETING ITERATORS!!!!!!!). For the sake of this thread let's just say that the process of doing this is extremely frustrating and that I have to debug certain things so my idea was to take a look into the WHATEVER is the CURRENT row in executeQueryForCollection of VO2:
    //in VO2ViewImpl.java
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams)
        // TODO:  Override this oracle.jbo.server.ViewObjectImpl method
        Row currentRow = this.getCurrentRow();
        if (currentRow != null)
           Object[] o = currentRow.getAttributeValues();
      //    if (o!=null)
            //System.out.println("val[0]= " + o[0]);
            //System.out.println("val[0]= " + o[1]);
            //System.out.println("val[0]= " + o[6]);
            //System.out.println("val[0]= " + o[8]);
    }My application breaks at Object[] o = currentRow.getAttributeValues();
    for some reason? Why???
    The error displayed is:
    JBO-26100: An error occurred after commit was performed.
    The bottom line question is what is the current query in executeQueryForCollection?

    Here is what I have:
    Master-detail-detail
    VO1
    --VO2 via VO1VO2Link
    -----VO3 via VO2VO3Link
    I am editing or creating new record in VO3 (Say UIX input form) but want to implement 'rollback' button and go back to the CURRENT row in VO2 (WITHOUT RESETING ITERATORS!!!!!!!). For the sake of this thread let's just say that the process of doing this is extremely frustrating and that I have to debug certain things so my idea was to take a look into the WHATEVER is the CURRENT row in executeQueryForCollection of VO2:
    //in VO2ViewImpl.java
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams)
        // TODO:  Override this oracle.jbo.server.ViewObjectImpl method
        Row currentRow = this.getCurrentRow();
        if (currentRow != null)
           Object[] o = currentRow.getAttributeValues();
      //    if (o!=null)
            //System.out.println("val[0]= " + o[0]);
            //System.out.println("val[0]= " + o[1]);
            //System.out.println("val[0]= " + o[6]);
            //System.out.println("val[0]= " + o[8]);
    }My application breaks at Object[] o = currentRow.getAttributeValues();
    for some reason? Why???
    The error displayed is:
    JBO-26100: An error occurred after commit was performed.
    The bottom line question is what is the current query in executeQueryForCollection?

  • Change the current row in an iterator and reflect the change on page

    Hi there,
    I have a jspx with a creation form created as usual draging and droping the data control. In same page, I inserted a commandButton which ActionListener executes a method in a managed bean called validate(). Through such a method what Im trying to do is to fill the form with data from specified entry of the database if certain condition is true. I know it is kinda twisted but unfortunately is the requirement for the page.
    So basically in "validate" method, if the condition I mentioned is reached, I do the following:
    // execute a Rollback (included in Page Definition) in order to cancel the previous auto-invoked "Create".
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    BindingContainer bindings =(BindingContainer)app.getVariableResolver().resolveVariable(context,"bindings");
    OperationBinding opBinding = bindings.getOperationBinding("Rollback");
    opBinding .execute();
    //get the iterator and asociated VO from the binding container
    ValueBinding vb = app.createValueBinding("#{bindings.AccountsVOIterator}");
    DCIteratorBinding dciter = (DCIteratorBinding) vb.getValue(FacesContext.getCurrentInstance());
    ViewObject view = dciter.getViewObject();
    //and set the current row with the specified entry I have mentioned above.
    Object keyValues[] = new Object[2];
    keyValues[0] = "1"; keyValues[1] = "98543";
    Row[] row = view.findByKey(new Key(keyValues),1);
    AccountsVpnVORowImpl client = (AccountsVpnVORowImpl)row[0];
    view.setCurrentRow(client);
    view.executeQuery();
    dciter.setCurrentRowWithKey(client.getKey().toStringFormat(true));
    dciter.executeQuery();
    opBinding = bindings.getOperationBinding("Execute");
    opBinding.execute();
    All this works perfectly when I debbug it but I cannot see the changes in the page(even refreshing browser). I need that when such a condition is met, the creation form turns into a modify-specific entry form, filling all fields with the specific data in order user can modify it, and all in the same page.
    Any clue?
    Thanks so much in advance for your time.

    Hi,
    I could see the problem with call to executeQuery and execute methods at the end of your method which re-sets the current row.
    Once you set the current row you should not call execute or executequery methods. Try removing those calls and also make sure that you have added partialTriggers property on the table is set to commandbutton id and partialSubmit property is set to true on commandButton to refresh the table partially on click of a button
    Sireesha

  • Differentiating the current Row

    Hi
    I am using Jdeveloper 9.0.5.1. All my pages are designed in UIX.. My client is asking me to help him navigating among a list or record by giving the current row a different visual attributes..
    Please help
    ammar

    Perhaps you can set a transient field in your view object that determines what visual attribute would be shown, and then in your uix code for each row determine the style class based on that value using jstl tags. I don't have an example with setting the class, but I can't see why that wouldn't work.
    You could code the visual attributes into your css file.

  • Losing the current row without doing anything

    I using 10g and my page have a VOR (viewobject readonly) to control form data but...
    I'm losing several times the current row ... for example I put this code in a button:
    public String clickAction() {
    AdminUCAtoCartorarioAMImpl am = null;
    try {
    am = ( AdminUCAtoCartorarioAMImpl )super.getApplicationModule( "AdminUCAtoCartorarioAMDataControl" );
    am.getAmbienteEscaninhoVOR().getCurrentRow(); //Here, sometimes brings me null.
    } catch (Exception e) {
    e.printStackTrace();
    return null;
    }

    User,
    You give us the symptom of the problem, but
    I'm losing several times the current rowdoesn't help anyone to help you pinpoint what might be the cause. Under what circumstances does the current row come across as null? Are you manually iterating through the VO's row set somewhere? What happens before the current row is "lost?" What specific version (your tag indicates 10g, but specifically which version) of JDeveloper/ADF are you using? Does this occur only when deployed, or does it occur when running in the embedded OC4J.
    One thing for you to try... if it occurs "sometimes," seemingly randomly under load, try turning off Application Module Pooling and re-test. If it occurs every time with pooling turned off, you are likely seeing some issue related to passivation/activation - which is why it would be critical to mention the exact version; there are known issues with specific versions, and there are patches available.
    John

Maybe you are looking for