Reset of current row after commit in ADF-UIX

Dear experts,
I have developed an application with Oracle JDeveloper 10g and ADF-UIX using BC4J. The problem is that wherenever a commit is performed the current row for the master table is reset which causes confusion for the end user.
Do you know how can I solve that problem?
Thank you in advance,
Constantine

... I forgot to mention that I use JDeveloper 3.1 on Windows NT4.
About my problem, it seems that a "key" does not exist in the record (Row object) i'm using for.
So, what really is a "key"? Is this an internal complicated number or just the values of some data fields, indicated as "Primary Key" in the table?
If the answer is the second one, I have to say that at the really before commit of the record, the value of my primary key fields is NULL, because they are filled up by a "sequence object" created in the database (triggered by a "TRIGGER BEFORE INSERT", which calls the "sequence.nextval" SQL command).
So, I really have the value of my primary key fields just after committing the record in the database, and would explain everything.
But is really this the "key"?
Thanks

Similar Messages

  • Refresh only current row after commit, when ChangeEventPolicy set to none

    Hi,
    I'm using jdeveloper 11.1.2.3.0
    I'm editing a table with a popup, I set the ChangeEventPolicy to none because it made some problems.
    Now I would like to know, when i'm closing the popup and doing commit,
    how could I refresh only the current row, and not whole the table?
    I would like it to work as with ChangeEventPolicy set to ppr.
    Thanks!

    could you please explain a little bit more?
    When I used the ChangeEventPolicy with ppr it looks like only the selected row was changed after commit.
    but with PartialTrigger i see that it's refreshing all the table.
    are you sure they are working the same?
    what about row.refresh(..), is it only used for rollback?

  • Change current row selected Color in ADF rich client table

    Hi All ..
    i want to change the current row selected from the default ADF color to Another color.
    i am not very good in javaScript .
    any one can help me
    Edited by: user9519817 on Aug 30, 2008 3:57 AM

    User,
    You don't need Javascript to do this. Have a read of section 18 of the Oracle Web user Interface Developer's Guide for Oracle Application Development Framework (found [url http://download.oracle.com/otn_hosted_doc/jdeveloper/11/doc/b31973.pdf]here for information about creating a custom skin. Unfortunately, the documentation for the selectors to use, which should be in a JDev help topic titled, ""Selectors for Skinning Fusion's ADF Faces Components" doesn't exist yet :( However, you can check [url http://www.oracle.com/technology/products/adf/adffaces/11/doc/skin-selectors.html#]here for that information.
    Selectors that may be of interest:
    .AFTableCellDataSelectedColor:alias
    .AFTableCellDataSelectedBandedColor:alias
    .AFTableCellDataSelectedInactiveColor:alias
    .AFTableCellDataSelectedBandedInactiveColor:alias
    Best,
    John

  • Get No. of Affected Rows After Commit

    In my application, I'm showing data in af:table which is editable.
    I need to show the no. of rows affected after calling a commit.
    Edited by: Anooj on Nov 21, 2011 10:52 PM

    There are some possible solutions for your problem. Only we can't help if you tell us which jdev version you are using and which technology you are working on.
    Timo

  • How to set current row in table after use tab key on inputText

    Hello all,
    My first post .., I'm newbie in ADF and I will try to explain my problem.
    For the moment we use ADF 11g (11.1.1.4), in a jsff page I have a table with an inputText column.
    On the valueChangeListener of the inputText, I invoke a method in a viewScope bean which call an EJB method, make some services in the EJB on the line modified. After that I refresh the VO and the table (because others values on the line have been modified) and reset the focus on the same inputText modified by the user with javaScript because focus was lost after refresh.
    So far, everything works fine.
    When I use the arrow keys to change the selected row in the table, it's work fine (focus is still in the next or previous inputText), but if user try to use tab key to change the current line, the inputText on the next line have the focus but the current row of the table is not changed (I think it's normal).
    My question : how can I change the current row after tab key pressed in this case ?
    I don't know if it's really clear, not easy to explain, don't hesitate to ask more details.
    Thanks in advance.

    Frank Nimphius wrote:
    Hi,
    My question : how can I change the current row after tab key pressed in this case ?
    Use a client event to listen for the keyboard entry and intercept the tab. The use af:serverListener to call the server to set the rowKey on the table and issue a PPR for the table to re-paint
    See sample 11 on http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples
    to learn about how to use the client listener and server listener
    FrankHi,
    Thanks a lot for your advices, I used the client and server listener
    I used this code on the method call in order to change the selection after key tab pressed, I don't know if it can be easier, but it works.
              if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("START changeSelectedRow");
              RowKeySet oldRowKeySet = myTable.getSelectedRowKeys(); // get oldRowKeySet
              if (oldRowKeySet == null) {
                   if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("oldRowKeySet is null");
                   return;
              RowKeySetImpl newRowKeySet = new RowKeySetImpl(); // The new RowKeySet use to change the selectedRow
              DCIteratorBinding bindingIterator = ADFUtils.findIterator(MY_ITERATOR);
              bindingIterator.setRangeSize(-1);
              // set the new index of the current row.
              int index = bindingIterator.getCurrentRowIndexInRange();
              if (index < bindingIterator.getAllRowsInRange().length - 1) {
                   index++;
              bindingIterator.setCurrentRowIndexInRange(index);
              // get the current row after changed the index
              Row currentRow = bindingIterator.getCurrentRow();
              if (currentRow != null) {
                   ArrayList nextLst = new ArrayList(1);
                   nextLst.add(currentRow.getKey());
                   newRowKeySet.add(nextLst);
                   // set the new selectedRow
                   myTable.setSelectedRowKeys(newRowKeySet);
                   SelectionEvent selectionEvent = new SelectionEvent(oldRowKeySet, newRowKeySet, myTable);
                   selectionEvent.queue();
                   AdfFacesContext.getCurrentInstance().addPartialTarget(myTable);
              if (LOGGER.isDebugEnabled()) {
                   LOGGER.debug("END changeSelectedRow");
    Best Regards
    Benjamin

  • Iterator refresh after commit

    Hi,
    I have three tabs in my page , and in each tab , i have separate taskflows.
    The first tab taskflow contains a jsff which has lets say master table iterator i.e departments iterator.
    In the second tab, i have a table based on read only query, but when i click on add button, i will be inserting in to detail VO (employee VO) and using postChanges() .
    so that read-only query based table gets the new data.
    now when i click on save button and commit , the iterators in taskflows of tab1, tab2 are pointing to first record rather than the current record.
    1) even i tried with having an action for the 'save' button and navigating to method activity which sets the iterator to current row.
    When i am returning back to taskflow,i am still seeing the iterator pointing to first record rather than the current record i intend to see.
    could anybody tell me why iterator is pointing to first row after commit()
    i don't have 'refresh' -- if needed for taskflows. its default.
    for transactions, datacontrols, its default for my taskflows.

    I generally retain the previously selected row using the following code in my VOImpl after every executeQuery().
    public void executeQuery()
    // current row key if any
    Key currentRowKey = null;
    Row currentRow = getCurrentRow();
    if ( currentRow != null )
    // get current row key
    currentRowKey = getCurrentRow().getKey();
    // super call
    super.executeQuery();
    if ( currentRowKey != null )
    // set current row now using previously stored key
    Row[] rows = findByKey( currentRowKey, 1 );
    if ( rows != null && rows.length == 1 )
    setCurrentRow( rows[0]);
    }

  • After commit current row is no longer highlighted

    JDeveloper 11.1.1.20.
    Scenario: a master detail page where master and detail are both ordinary ADF table ( NOT read-only).
    If I place the cursor on a master row and do a click the row is highlighted.
    If I do a createInsert operation (with a button) a new row is created above the previous mentioned row.
    Problem:
    If I do a commit after the new row is filled with data sometimes the newly made row is now longer highlighted after the commit.
    The newly created row is stil active. This is seen by the fact that if I subsequently creates a new deatil row it is correctly connected to the newly created master row.
    And - after the newly created detail row is created the master row is again highligted.
    Any ideas?
    Best regards
    Erik

    Hi,
    To keep highlight the selected row do some operation in bean ,Get selected row and set that row again after commit
    Check
    http://jobinesh.blogspot.com/2011/01/declaratively-setting-current-row-key.html

  • Row selection in adf table issue after commit or rollback

    Using jdev 11g (11.1.1.62)
    I have a adf table with multi select enabled. There is a child table bounded at BC4J level via a VL
    On the rowSelectionListener I attached a bean method. This bean method bascially finds the selected row from UI and then based on it query the child vo again and then finally refreshes the child table.
    This works fine as expected.
    However, what happens is when the Cancel button is called on UI which is bound to a rollback action in the AMImpl then the UI refreshes. And the master table still shows the previously selected row but the child VO shows the rows of the first master VO row rather the selected one.
    How to fix this? Further as old row is already selected in the master table so reclicking on the same row does nothing,

    just to update after the rollback is called in the cancel button i wrote following code which does not change the row focus to the first row
    DCBindingContainer bc =
    (DCBindingContainer)BindingUtils.getBindingContext().getCurrentBindingsEntry();
    DCIteratorBinding profItr =
    bc.findIteratorBinding("ProfileSearchInstIterator");
    Row cRow = profItr.getRowAtRangeIndex(0);
    if(cRow != null){
    System.out.println("Current row is not null so fixed ");
    profItr.setCurrentRowIndexInRange(0);
    RowKeySetImpl rks = new RowKeySetImpl();
    ArrayList keyList = new ArrayList();
    keyList.add(cRow.getKey());
    rks.add(keyList);
    profileTable.setSelectedRowKeys(rks);
    AdfFacesContext.getCurrentInstance().addPartialTarget(profileTable);
    }

  • 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.

  • How to insert the new row after current row in RowIterator - Steve Muench

    Hi,
    Our client wants the new row to be added after current row on the front end instead of before current row.
    we were using "new JUActionBinding(this,iterBinding,JUActionBinding.ACTION_CREATE_INSERT_ROW);" this code inserts the new row after current row.
    I tried a lot to insert the new row after current row. Used new JUActionBinding(this,iterBinding,JUActionBinding.ACTION_LAST to move the cursor to last row in rowiterator and the used .ACTION_CREATE_INSERT_ROW but this thing inserts the new row as the second last row.
    Could somebody plesae help ?
    Message was edited by:
    user556161

    I am using JDeveloper 9.0.4.2.0 (Build 1459)

  • How to set text and background color of current row in a adf table?

    Hi,
    In jdev 11.1.2.3,
    How to set text fond and background color of current row in a adf table?
    I tried to set Background color in table property, but that is not what i want.
    Thanks.

    Hi,
    We almost had the same requirement, but we just needed to color a specific column.
    Here goes the solution to that, you might do the same for your row highlighting
    Changes are required in jsff and one method to be added in backing bean
    1. JSFF :
    <af:column headerText="Amount"
                     id="c4" width="100"
                     inlineStyle="#{backingBeanScope.BackingBean.cellColor}">2. Backing Bean
    //searchResultTableVO is Table's VO
    public String getCellColor() {
          FacesContext ctx = FacesContext.getCurrentInstance();
          ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
          ValueExpression ve = ef.createValueExpression(ctx.getELContext(), "#{row}", FacesCtrlHierNodeBinding.class);
          FacesCtrlHierNodeBinding node = (FacesCtrlHierNodeBinding)ve.getValue(ctx.getELContext());
          Row row = node.getRow();
        if(row.equals(searchResultTableVO.getCurrentRow())){
    //You can add your inline style for font-style too
          return "background-color:Red;";
             return null;
      }Hope this is helpful :)
    Regards,
    Neha..

  • How can I make the current row in a different color  in  ADF Table 10.1.3

    Hi all
    in JDeveloper 10.1.3 ADF Table ,
    How can I make the current row in a different color ?
    thanks

    And what exactly would "the component" be?
    I tried the af:outputText, but it just creates a <span> around the value of the cell, and if I try the af:column it just won't use it at all!
    Any suggestions?

  • Resetting row after validation

    Hi all,
    I am having the following requirement.
    In the table, when iam traversing from one row to another iam doing validation. Validation getting fired successfully But the row is not moving the previous position where as it is retaining in the newly selected row.
    eg: in the first row ,iam doing field level validation,and traversing to the next row. If the validation fail, row focus should be in the first row rather than the traversed row.
    My requirement i want to make the row in the table as current row through programmatically. i.e if any validation failure occurs it should display the validated row as selected Instead of newly row as selected.
    Any solutions....
    My jdeveloper version : 11.1.2.0.0
    reg,
    Bakkia.

    Hi,
    Thanks for your co-opearaion.
    You are right. But still some updation is there. I will explain you the scenario with Example.
    I have dragged and dropped Departrment Table into My JSpx. It contains 10 rows.(for eg.)
    I have Overrided the Method of Selection listener in the Table.
    I am having validation for Department name like "Department Name should not contain double quotes or Asterik" . This validation i have kept in the ViewObject Impl level.
    Iam Entering the Department name by violating the condition to check whether it is working properly or not.
    I make the changes in the 3 rd row and traversing to the next row i.e 4th row.
    In the row selection listener iam validating the changed row by calling the valdiation method via client interface. If the validations success iam making the next row as current.
    If the validation get failed, Message should get displayed and row selection should be in the 3rd row only.
    This is my requirement.
    I tried your solution in the row selection listener as well as button action listener.
    It didn't help me.
    Any solutions
    reg,
    bakkia
    Edited by: Bakkia on Oct 3, 2011 2:37 AM

  • 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?

  • How can i validate current row input text field like required.

    Hi All,
    jdev 11.1.2.1.0
    in my use case i have drag drop one viewobject as a adf table. and in table i have also add one extra input text field which is not based on
    vo.
    now i want to validate current row input text field not null when i commit row.
    but when i using required property true. it worked for all row in table. problem is that i want only current row input text field validate not all
    thanks,
    Manish

    When the user tries commit the data by clicking on the button -- For that button, have the logic in the actionlistener method to check if the additional input field is NULL or NOT.
    If it is NULL, show an error message using FacesContext.addMessage() API.
    Thanks,
    Navaneeth

Maybe you are looking for