How to save only the selected line

Hi all

I have a page master / detail with two regions advanced table.
Region of the main table has a transient 'SelectFlag' attribute to display the detail records.

When I make a few changes to a master record and save it is save all records on the page.

I want to save only the selected record.

How to get there?

Help, please. :)

You need to loop through the rows using RowSetIterator.

Reference http://oracleanil.blogspot.com/2010/05/delete-exercise-delete-row-from-table.html

-Anand

Tags: Oracle Applications

Similar Questions

  • How to get only the new lines

    Hello

    I have a table as below

    emp_id (integer)
    id_est (integer)
    dt_est (date)

    for each emp_id I have several id_est with several dt_est... as below

    emp_id id_est dt_est
    1 1 10-01 - 2009
    1 2 2009 - 01 - 13
    2 3 2009 - 01 - 10
    2 4 2009 - 01 - 12
    2 5 2009 - 01 - 14
    3 6 2009 - 01 - 12
    4 7 2009 - 01 - 15
    5 8 2009 - 01 - 17
    5 9 2009 - 01 - 19

    I would get just the news lines function date each emp_id, so my result should be as below

    emp_id id_est dt_est
    1 2 2009 - 01 - 13
    2 5 2009 - 01 - 14
    3 6 2009 - 01 - 12
    4 7 2009 - 01 - 15
    5 9 2009 - 01 - 19

    How I do that?

    Thank you

    Hello

    Try this code.

    Salim cordially.

    SELECT   id_emp, MAX (id_est), MAX (dt_est)
        FROM t
    GROUP BY id_emp
    
  • save after focus leaves cell saves only the first line

    I want that every cell in a table to save when focus leaves the cell. It seems that any line I am on it will always save this value in the first row. After that, I think it seems to save the new value in the correct lines. How can ensure me that the relevant line is saving?

    This is the code for my laptop...
    < af:inputText value = "#{rank." Simple PublishedNotes}' = 'true '.
    required = "#{bindings." CIsForRR.attrDefs.Notes.mandatory}.
    columns = "#{bindings." CIsForRR.attrHints.Notes.displayWidth}.
    Binding = "#{bindings_app_ci_RR.inputText5} '"
    ID = "inputText5" lines = '10' autoSubmit = 'true '.
    valueChangeListener = "#{bindings_app_ci_RR.save_notes_action} '"

    Then my save_notes_action looks like this...
    {} public void save_notes_action (ValueChangeEvent vce)
    FacesContext ctx = FacesContext.getCurrentInstance ();
    Bind ValueBinding = ctx.getApplication ().createvalueBinding("#{data}");
    BindingContext, bc = bind.getValue (ctx) (BindingContext);
    DC DCDataControl = bc.findDataControl("AppModuleDataControl");
    AppModuleImpl am = (AppModuleImpl) dc.getDataProvider ();

    ViewObject vo = am.findViewObject ("RR");
    Line = vo.getCurrentRow ();
    prints the value of vce and the attribute of the current name of the lines
    String newVal = valueChangeEvent.getNewValue (m:System.NET.SocketAddress.ToString ());
    row.setAttribute ("Notes", newVal);
    am.getTransaction () .commit ();
    Refresh();
    }

    My impressions always printed the first line of name.

    Any help is appreciated! Thank you!

    That's because you manually make the change in your code:
    String newVal = valueChangeEvent.getNewValue (m:System.NET.SocketAddress.ToString ());
    row.setAttribute ("Notes", newVal);
    am.getTransaction () .commit ();

    Why not use a table can be changed with the binding of the ADF and simply let ADF do all the work for you.

  • How to play only the selected on 'test' images / listen to music on 'play '?

    I use Adobe Flash Pro 2015 CC and I do a long animation (about 5 minutes) when I synchronize the frames to the song in the background. If I press on "ctrl + enter" and test the movie, then it always starts from the beginning no matter what I try. If I hit enter and play the animation, then it starts from where I want it, but no music can be heard.

    Preferably, I'd like to be able to listen to music when I click on play, but if this is not feasible (I know 'play' has its limits) so I wish I could at least 'test' try it with only selected images. (I want to all both know anyway for future use)

    Nevermind, I found the answer online. I needed to do a right click on the layer of the music, go to properties, and under 'her', I changed the option to synchronize the 'event' 'Stream '. The music is heard now when I click on enter/read.

  • Enter the selected line only an editable af:table ADF

    Hello

    We have an obligation to engage only the selected lines in a table. All lines in the table must be modifiable. There should be a 'Save' button in a column that has to save the selected line when you click it.

    Could you please share your comments/suggestions.

    Environment:

    JDeveloper and ADF 11.1.1.7

    Thank you

    Srikanth

    Maybe you can add the attribute transitional to EO as an indicator whether the line should be validated in db or not, override EOImpl.doDML () and skip super.doDML () If this attribute is not set.

    Dario

  • How to create the map that updates only the changed lines

    Hello

    I have a map that made a merger (update/insert) in a table. The problem is that it will always update all rows in this table. I want to update only the changed lines.

    Some dummy code that shows what I want to do.
    Current situation (all lines updated):

    FUSION
    IN
    Table 1-t1
    USING
    (select key_column, Column1, Column2 from table2) t2
    ON)
    T1.key_column = t2.key_kolumn
    )

    WHEN MATCHED THEN
    UPDATE
    SET
    T1. Column1 = t2.column1
    T1. Column2 = t2.column2
    WHEN NOT MATCHED THEN
    INSERT
    (t1.key_column, t1.column1, t1.column2)
    VALUES
    (t2.key_column, t2.column1, t2.column2);

    What I'm trying to get (only changed the lines updated):
    FUSION
    IN
    Table 1-t1
    USING
    (select key_column, Column1, Column2 from table2) t2
    ON)
    T1.key_column = t2.key_kolumn
    )

    WHEN MATCHED THEN
    UPDATE
    SET
    T1. Column1 = t2.column1
    T1. Column2 = t2.column2
    * WHERE
    T1. Column1! = t2.column1
    or t1.column2! = t2.column2*
    WHEN NOT MATCHED THEN
    INSERT
    (t1.key_column, t1.column1, t1.column2)
    VALUES
    (t2.key_column, t2.column1, t2.column2);

    WHERE in WHEN MATCHED t clause is that I'm not able to create via OWB in the mapping. How is that possible?
    I tried to look for the solution here and google without success

    Thank you!

    Hello

    you left outer join table2, with table1. Then use a filter to determine which rows in which an attribute has changed or no towing in table1 where found.
    To compare attributes use expression with nvl to properly handle nulls: nvl(table2.my_attribute,'#')! = nvl(table1.my_attribute,'#')

    Kind regards
    Carsten.

  • Mr President, how can I enter two rows at the same time with different default values that only the first line to use see?

    Mr President.

    My worm jdev is 12.2.1

    How to enter two rows at the same time with different default values that only the first line to use see?

    Suppose I have a table with four fields as below

    "DEBIT" VARCHAR2(7) , 
      "DRNAME" VARCHAR2(50),
      "CREDIT" VARCHAR2(7) , 
      "CRNAME" VARCHAR2(50),
    

    Now I want that when I click on a button (create an insert) to create the first line with the default values below

    firstrow.png

    So if I click on the button and then validate the second row with different values is also inserted on commit.

    The value of the second row are like the picture below

    tworows.png

    But the second row should be invisible. It could be achieved by adding vc in the vo.

    The difficult part in my question is therefore, to add the second row with the new default values.

    Because I already added default values in the first row.

    Now how to add second time default values.

    Concerning

    Mr President

    I change the code given by expensive Sameh Nassar and get my results.

    Thanks once again dear Sameh Nassar .

    My code to get my goal is

    First line of code is

        protected void doDML(int operation, TransactionEvent e) {    
    
            if(operation != DML_DELETE)
                 {
                     setAmount(getPurqty().multiply(getUnitpurprice()));
                 } 
    
            if (operation == DML_INSERT )
                       {
                               System.out.println("I am in Insert with vid= " + getVid());
                           insertSecondRowInDatabase(getVid(),getLineitem(),"6010010","SALES TAX PAYABLE",
                            (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                           }
    
            if(operation == DML_UPDATE)
                              {                                                    
    
                                 System.out.println("I am in Update with vid= " + getVid());
                             updateSecondRowInDatabase(getVid(),
                                 (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                              }                      
    
            super.doDML(operation, e);
        }
        private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "Insert into vdet (VID,LINEITEM,DEBIT,DRNAME,AMOUNT) values " +
                 "('" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "','" + value5 + "')";  
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }
                  }  
    
                  private void updateSecondRowInDatabase(Object value1, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "update vdet set  AMOUNT='"+ value5+"' where VID='" + value1 + "'";                     
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);  
    
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }                  
    
                  }
    

    Second line code is inside a bean method

        public void addNewPurchaseVoucher(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("VoucherView1Iterator");
                   RowSetIterator rsi = dciter.getRowSetIterator();
                   Row lastRow = rsi.last();
                   int lastRowIndex = rsi.getRangeIndexOf(lastRow);
                   Row newRow = rsi.createRow();
                   newRow.setNewRowState(Row.STATUS_NEW);
                   rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
                   rsi.setCurrentRow(newRow);
    
                   BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("VdetView1Iterator");
                   RowSetIterator rsi1 = dciter1.getRowSetIterator();
                   Row lastRow1 = rsi1.last();
                   int lastRowIndex1 = rsi1.getRangeIndexOf(lastRow1);
                   Row newRow1 = rsi1.createRow();
                   newRow1.setNewRowState(Row.STATUS_NEW);
                   rsi1.insertRowAtRangeIndex(lastRowIndex1 +1, newRow1);
                   rsi1.setCurrentRow(newRow1);
        }
    

    And final saveUpdate method is

        public void saveUpdateButton(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindingsBC = BindingContext.getCurrent().getCurrentBindingsEntry();      
    
                   OperationBinding commit = bindingsBC.getOperationBinding("Commit");
                   commit.execute(); 
    
            OperationBinding operationBinding = BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit");
            operationBinding.execute();
            DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("VdetView1Iterator");// write iterator name from pageDef.
            iter.getViewObject().executeQuery();  
    
        }
    

    Thanks for all the cooperation to obtain the desired results.

    Concerning

  • How can disable us the selection of lines under condition

    Hi Experts,

    JDEV version 12.1.3.0

    How can disable us the selection of lines under certain conditions.

    As the lines newly unregistered should be allowing the selection of lines.

    Saved lines should be disabled from the selection.

    Can achieve us.

    Please me advice accrdingly

    Thank you

    Roy

    You are implementing a generic selection as shown here http://www.oracle.com/technetwork/developer-tools/adf/learnmore/23-generic-table-selection-listener-169162.pdf Manager in this handler, you check and validate the selection of our not.

    Timo

  • How to highlight the selected line in an interactive report in apex5?

    Hello

    I want to emphasize the selected line in the report by changing the background color of the line. Basically, I want to do this. I really want to do is, select a row in the report and according to the selected line, I want to retrieve other data to another interactive report on the same page. So, how can I do this?

    Hi geslin,.

    Garza says:

    But here shows a link to another page or something like that. But I don't need that. I just want to show when the user selects a specific row by clicking on this line, and it should show that it has been selected by changing the color of the line and after having extracted a few hidden field and according to those column data display data on another report on the same page.

    Check your Application-> Page 2 30870. I've set up a dynamic action to reach the line highlighted when selected.

    Here are the steps to achieve the highlighted line:

    • Changed the definition of class employee culminating point to CSS-> section of the line on the page:
    .highlight-employee
       {
        background-color: blue !important;
        color: white !important;
       }
    
    • Commented the code written in JavaScript-> Execute JS when the section of the page to load the page.
    • Edited the ROWID of your interactive report column and set the following properties for 'column link:

    Text link: #ROWID #.

    Link attributes: id = "" #ROWID # "class ="monlien""

    Target: URL

    URL: javascript:void (0);

    • Dynamic action created with the following properties:

    Name: highlight_selected_row

    Event: click on

    Selection type: jQuery Selector

    jQuery Selector: a.mylink

    Action: Run the JavaScript Code

    Fire on loading the Page: No.

    Code:

    var row_id = this.triggeringElement.id;
    $('#P2_NEW').val(row_id);
    $('#'+row_id).parent().closest('tr').find('td').addClass('highlight-employee');
    

    Scope of the event: Dynamics

    Kind regards

    Kiran

  • [JDev12c, ADF] How to get the value of a field from the selected line in af:table and...

    Hallo,

    I want to double click on a line of an af:table to call a page that displays a form (based on a View object) with the details of the selected line.

    I need to go to the second page the value of a field on the line that is selected on the first page.

    How can I do this? In particular, how can I get the value of a field from the selected line? How can I call the second page on double-click on the af line: table?

    Thank you

    F.

    Why would user, you need to pass a value of the line to the shape?

    The framework selects the line you want to display in the form. All you have to do is to show the form with the selected line. It is the framework automatically as long as you use e vo even the same data control.

    Timo

    Post edited by: Timo Hahn
    And the handling double-clicks is described here http://www.oracle.com/technetwork/developer-tools/adf/learnmore/56-handle-doubleclick-in-table-170924.pdf

  • How can I default first line below the selected line in the table of the adf

    Hello

    I use Jdeveloper 11 g,
    I created Adf quick query with table and changed selectionListener table as #{CustRMMap.onRMGroupNameChange}.
    and when I click on find fast query no row is selected.
    I want the first row to be selected / highlighted by default when I click search.

    Patel Imran

    You can also set an attributeValue in pagedef.xml
    bind this attributeValue with column of your table. This sets the value of the selected line to the variable attruibute.
    Will now link this with your desired component attributeValue.
    Put partial trigger on the component that should display this value.
    This will save you to write custom code and use the default table selection listener property, which marks the first default line.

    Apart from this, if you want to govern the first default line of managed bean selection use this code...

    + _Table = selectionEvent.getSource ((richeTableau)) richeTableau; + *
    + / / the model in the Collection is the object that provides the structured data.
    + / / for rendering table +.
    + TableModel CollectionModel = table.getValue ((CollectionModel)); + *
    + / / the ADF object that implements the CollectionModel is JUCtrlHierBinding. IT +.
    + / /is wrapped by the CollectionModel API.
    + JUCtrlHierBinding adfTableBinding = tableModel.getWrappedData ((JUCtrlHierBinding)); + *
    + / / Acess the iterator ADF, binding that is used with the binding table ADF +.
    + DCIteratorBinding tableIteratorBinding = adfTableBinding.getDCIteratorBinding (); + *

    + / / the role of this method is to synchronize the table feature selection +.
    + / / with the selection of the model of the ADF +.
    + Object selectedRowData = table.getSelectedRowData (); + *
    + / / cast of JUCtrlHierNodeBinding, which is the subject of the ADF that is +.
    + / line/a +.
    + JUCtrlHierNodeBinding nodeBinding = selectedRowData (JUCtrlHierNodeBinding); + *
    + / / get the key of the node binding line and set it as the current line in the +.
    + / / iterator +.
    + Key rwKey = nodeBinding.getRowKey (); + *
    tableIteratorBinding.setCurrentRowWithKey (rwKey.toStringFormat (true)); + *

    and another way on the right is a custom like this code:

    + public void setDefaultRow (int count) {/ / call this method your method of selection custom, rom pass the line of the line to select index. count = 0, will select first row + *}

    + try {+ *}
    Object oldRowKey = tblMag.getRowKey (); *
    + try {+ *}
    This.

    .getSelectedRowKeys () .clear ();
    *
    * +} catch (System.Exception e) {+ *}
    System.out.println (e.getMessage ()); *
    +}+
    This..setRowIndex (count);
    *
    RKS RowKeySet =. getSelectedRowKeys();
    *
    (RKS). Add(. getRowKey());
    *
    RKS =. getSelectedRowKeys();
    *
    +.setRowKey (oldRowKey); +

    * +} catch (System.Exception e) {+ *}
    System.out.println ("error:" e.getMessage ()); + *
    +}+
    +}+

    Hope this helps

    Concerning
    Maryline Roussel

  • How to make the selection line more dark?

    It's my first time to use Photoshop CC, however, it is very difficult for me to see the selection line when I use "selection tool" to select an area, it is possible to adjust the darker line?

    Currently, I don't know of a way. However, I recommend that you post a suggestion on what makes the color and thickness of the pieces in the suggestion of photoshop forum.

    Community customer Photoshop family

  • Getting a value from all the selected lines in the method of the AM

    Hi all

    I use JDev 11.1.1.4.0

    I have a table with the selection of several lines. In my module application I want to call a stored procedure with the parameter whose value depends on the selected line in the table.
    For the only selection I can make fallow:
        public void wypiszId() {
            ViewObject vo = findViewObject("ProcsklView1");
            String st = vo.getCurrentRow().getAttribute("IdProcskl").toString();
            System.out.println(st);
    How can I deal with multiple selection?

    Kind regards
    Wojtek.

    Hello

    VO/iterator will hold only selected line at a time. Thus, for multi table enabled selection, the last selected line would be the selected line (vo / Iterator). In order to obtain all the selected lines, you must obtain support bean by linking the Table of the ADF.

    Check out this blog on this goal.

    http://blogs.Oracle.com/aramamoo/2010/12/getting_all_selected_rows_in_adf_table_with_multiple_rows_selection_enabled.html

    Arun-

  • Re: LaserJet M1319mfp saves only the last scanned sheet

    When I scan a douemnt of multiple page in PDF format it saves only the image of the last leaf?

    I set up a new user with admin rights and reinstalled the driver.  I don't know how long it took because that once he got to the point of "installing printer drivers" over and over again, I left the PC and it did something else.  When I came back he said that I had managed to install the printer drivers.  Funny, I can't always the driver in the "All programs" display/HP folder but the printer works again.  Where would he have filed the printer driver?

    The printer does not offer a scan to the PDF option that I need and so if I use interface of the printer I scanner JIFF or JPEG and then open Adobe, import and save to the PDF format.

    I tried scanning using Adobe 'create PDF from scanner' option which is how I always have done, and the output of scan of document is blank pages.  Very frustrating.  I can make a success analysis several sheet using Adobe to create from option scanner if I use the custom setting "Scan."  It works and if I'll live with it.  Thanks for your help.

  • How to call only the operations of several connectors of ICF through simple connector server

    Hi Experts,

    I developed two connectors of the ICF (ICF1 and ICF2) and placed the beams of connector on the same server connector.

    Please guide me how to get only the authorities of each of the connector to call operations of each separately.

    I use following code-

    List of < ConnectorInfo > this.getConnectorInfoManager = cInfos () .getConnectorInfos ();

    System.out.println (cInfos.Size ());

    for {(ConnectorInfo cInfo:cInfos)

    APIConfiguration apiConfiguration = cInfo.createDefaultAPIConfiguration ();

    setPoolConfigurations (apiConfiguration);

    Discoveryendpointspecifie configProps = apiConfiguration.getConfigurationProperties ();

    this.setUpConfigurationProperties (configProps);

    ConnectorFacadeFactory facadeFactory = ConnectorFacadeFactory.getInstance ();

    ConnectorFacade connectorFacade = (apiConfiguration) facadeFactory.newInstance;

    connectorFacade.test ();

    }

    Methods of all connectors are called here to test and how do I selectively invoke test() selective connectors?

    Hello

    The connector of the ICF is called by these configurations in the 'Lookup.CONNECTOR_NAME. Research of configuration. The search name is configured in the COMPUTER resource

    We have the following values configured in the search based on who the connector class fires is

    Name of the connector

    org.identityconnectors.CONNECTOR_NAME. Connector

    Main connector class identity. It is the class that implements the SPI of the ICF framework operations.

    Name of the bundle

    org.identityconnectors.CONNECTOR_NAME

    Name of the identity connector bundle

    In Version

    11.1.1.5.x

    Version connector identity

Maybe you are looking for