How to insert line or row in a table?

Hi OAF experts,
can anyone show me how to insert row or line in a table bean by setting the table.setAutoInsertion(false) ?
Thank you.
Jon

As per Dev Guide:---
The other change you can make is to suppress the default Add Another Row button behavior of adding a
single row to the view instance associated with the table, so that you can handle the event with your own code.
The following code example illustrates how to accomplish this:
processRequest
// Enabled add row and turn off the default "Add Another Row" table event
// The add row event has to be auto-handled by developer in processFormRequest
tableBean.setInsertable(true);
tableBean.setAutoInsertion(false);
processFormRequest
if ((tableBean.getName()Equals(pageContext.getParameter(SOURCE_PARAM))) &&
(ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM))))
OAApplicationModule am = pageContext.getApplicationModule(tableBean);
am.invokeMethod("handleInsertRow", null);
// The ***AMImpl.java in which method "handlInsertRow" has been defined
public void handleInsertRow()
OAViewObject vo = findViewObject("voName");
vo.invokeMethod("handleInsertRow");
// The ***VOImpl.java which is associated with the table; and in which the
// handleInsertRow is defined
public void handleInsertRow()
Row row = createRow();
// Set any default attributes
row.setAttribute(...);
// Insert the row into the VO
insertRow(row);
Thanks
--Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to insert a new Row in a table? - Need help

    Hi everyone,
    I'm using JDeveloper 10.1.2, UIX pages and STRUTS.
    This is my situation: When I navigate from page one to page two, I have in my page2 one table and I need to create a new row with some values by default, but I don't want to commit this line except the user decides to complete this line.
    Can anyone help me? This is very important.
    Thanks,
    Atena

    Hi Sascha,
    thanks very much for your replay.
    My project changed and I have another question about this. My page1 has a table (table1) and when I select one line from table1 and press a button, I go to page 2.
    I have an action in the Struts-Config.xml like this in page2 (S2PopUpObstaculos):
    <action path="/S2PopUpObstaculos" type="oracle.jheadstart.controller.strutsadf.action.JhsDataActionSaveObstaculos" className="oracle.jheadstart.controller.strutsadf.action.JhsDataActionMapping" parameter="/WEB-INF/page/S2PopUpObstaculos.uix" name="DataForm">
    <set-property property="modelReference" value="S2AltaSociais2UIModel"/>
    <set-property property="bindParams" value="S2DominiosLevel1Iterator=${data.S2AltaSociais2UIModel.Obstaculo},${data.S2AltaSociais2UIModel.AlsEpsPsId},${data.S2AltaSociais2UIModel.AlsEpsId},${data.S2AltaSociais2UIModel.Obstaculo}"/>
    </action>
    But now, the problem is, if I don't select one Row from table1 and press the button to go to page2, I need to pass diferent parameters to page 2, like this:
    <set-property property="bindParams" value="S2DominiosLevel1Iterator=0,${data.S2AltaSociais2UIModel.AlsEpsPsId},${data.S2AltaSociais2UIModel.AlsEpsId},0"/>
    </action>
    Do you have any ideia how to do this? Can you help me?
    Thanks,
    Atena

  • How to insert a new row in the middle of an set of rows

    Hi
    How to insert a new  row in the middle of an set of rows ? and How to Reset the line id after the new row added ?
    Regards,
    Sudhir B.

    Hai,
    just try this,
    Instead of using omatrix.Addrow(1,-1) use like
    omatrix.AddRow( RowCount , Position)
    RowCount
    The number of rows to add (default is 1)
    Position
    The position of the new rows (0-based; default is -1, meaning append row to the end)
    After adding rows in matrix For, sno.
    for i=1 to omatrix.visualrowcount
    otext=omatrix.getcellspecific("columnid",i)  '--where columnid is the unique id of the sno column
    otext.value=i
    next i
    Hope this helps you.
    Thanks & Regards,
    Parvatha Solai.N

  • How to insert line number into APPLIED_CUSTOMER_TRX_LINE_ID?

    Hi All,
    I am working on the table of receivable AR_RECEIVABLE_APPLICATIONS_ALL.
    I get some information about APPLIED_CUSTOMER_TRX_LINE_ID form TRM.
    APPLIED_CUSTOMER_TRX_LINE_ID     NUMBER     (15)     
    The line number of the debit item or credit memo to which a payment or credit memo is applied
    So, I want to use APPLIED_CUSTOMER_TRX_LINE_ID to join with transaction's line (RA_CUSTOMER_TRX_LINES_ALL).
    But after applied the credit memo, the APPLIED_CUSTOMER_TRX_LINE_ID is NULL.
    How to insert line number into APPLIED_CUSTOMER_TRX_LINE_ID?

    Hi Eric,
    The application is already at the AR Invoice (header) level. Oracle doesn't give you privilege to apply the invoice at invoice line or distribution level. You need to match the applied_customer_trx_id to customer_trx_id of ra_customer_trx_all to get the applied invoice/debit memo number. Hope my comments are helpful to you.
    KG

  • How could I insert the deleted row into another table within a trigger?

    Hi,
    How could I insert the deleted row into another table within a trigger? The destination table has the same columns as the source table. Since the statements are in the trigger, it is not allowed to query the source table named 'test'. Thanks! The trigger is as follows, uncompleted:
    CREATE TRIGGER delete_trigger
    AFTER DELETE
    ON test
    FOR EACH ROW
    BEGIN
    -- How could I insert the deleted row into another table
    END delete_trigger;
    Message was edited by:
    user569548

    Hi,
    I'm not sure what's wrong there.
    I read the oracle docs about ANALYZE and ALL_TAB_COLUMNS, and did the following:
    ANALYZE TABLE my_tab VALIDATE STRUCTURE; //went ok.
    SELECT column_name
    FROM all_tab_columns
    WHERE table_name = 'my_tab'; //but no rows selected?
    This topic might not be what this thread should be about. Here I posted a new thread:
    How to get colum names of the newly created table?
    Thanks.
    Message was edited by:
    user569548

  • How to insert select columns from one internal table to another

    Hi,
    How to insert select columns from one internal table to another based on condition as we do from a standart table to internal table.
    regards,
    Sriram

    Hi,
    If your question is for copying data from 1 int table to other ;
    we can use
    APPEND LINES OF it_1 TO it_2.
    or if they have different columns then:
    loop at it_1 into wa_it1.
    move wa_it1-data to wa_it2-d1.
    apped wa_it2 to it_2.
    clear wa_it2.
    endloop.
    thnxz

  • How to list all the rows from the table VBAK

    Friends ,
    How to list all the rows from the table VBAK.select query and the output list is appreciated.

    Hi,
    IF you want to select all the rows for VBAK-
    Write-
    Data:itab type table of VBAK,
           wa like line of itab.
    SELECT * FROM VBAK into table itab.
    Itab is the internal table with type VBAK.
    Loop at itab into wa.
    Write: wa-field1,
    endloop.

  • How to insert data from JTable to mysql Table....

    hello everybody
    i need help about how to insert data from JTable to mysql table... i know about how to create Table model...facing problem about how to insert data from JTable to mysql table....any helping link or code ... ill be thankfulll....for giving me solution...

    table1.getValueAt(table1.getSelectedRow(),0)you are getting the value of a selected row... or if you want you can just use a loop..
    for(.....){
    table1.getValueAt(x,y);
    }I think you know INSERT STATEMENT.. here on it just string concat
    sample e.g. (This not insert)
    "delete from accrule " +
                    "where ruleid= " + tblRA.getValueAt(tblRA.getSelectedRow(),0)+
                    " and accountname='"+tblRA.getValueAt(tblRA.getSelectedRow(),1)+"'"

  • How to delete a particular row in ALV table

    Hi,
    How to delete a particular row in ALV table based on some condition(by checking value for one of the columns in a row)
    Thanks
    Bala Duvvuri

    Hello Bala,
    Can you please be a bit more clear as to how you intend to delete the rows from your ALV? By the way deleting rows from an ALV is no different from deleting rows from a normal table. Suppose you have enabled selection property in ALV & then select multiple rows and click up on a button to delete the rows then below would be the coding: (Also keep in mind that you would have to maintain the Selection property of the context node that you are binding to your ALV to 0..n)
    data : lr_table_settings  TYPE REF TO if_salv_wd_table_settings,
                 lr_config          TYPE REF TO cl_salv_wd_config_table.
      lr_table_settings  ?= lr_config.
    ** Setting the ALV selection to multiple selection with no lead selection
      lr_table_settings->set_selection_mode( value = cl_wd_table=>e_selection_mode-multi_no_lead ).
    Next delete the selected rows in the action triggered by the button:
    METHOD onactiondelete_rows .
      DATA:  wd_node TYPE REF TO if_wd_context_node,
             lt_node1 TYPE ig_componentcontroller=>elements_node,
             wa_temp  TYPE REF TO if_wd_context_element,
             lt_temp  TYPE wdr_context_element_set,
             row_number TYPE i VALUE 0.
      wd_node = wd_context->get_child_node( name = 'NODE' ).
      CALL METHOD wd_node->get_selected_elements
        RECEIVING
          set = lt_temp.
      LOOP AT lt_temp INTO wa_temp.
        wd_node->remove_element( EXPORTING element = wa_temp ).
      ENDLOOP.
      CALL METHOD wd_node->get_static_attributes_table
        EXPORTING
          from  = 1
          to    = 2147483647
        IMPORTING
          table = lt_node1.
      wd_node->bind_table( new_items = lt_node1 ).
    ENDMETHOD.
    If in case this isn't your requirement please do let me know so that I can try come up with another analysis.
    Regards,
    Uday

  • How to insert a gif file into a table?

    Hi,
    I need to insert a gif file into a table. Can anyone tell me where I can find the information on how to create this kind of table, how to insert a gif file into a table and how to select?
    Thanks,
    Helen

    Hi Helen,
    You could read about that in the documentation which is available online.
    For a starter: BLOB. And I bet there are many examples to be found on the web.
    Good luck. :)
    Regards,
    Guido

  • How to find newly updated rows in a table

    Hi..
    How to know newly updated rows in a table.
    Thanks in advance
    pal

    Or other good thing would be to add LAST_UPDATED column to your table, that can reflect the time the row gets updated.
    G

  • How to get count of rows for a table?

    Hi,
    How to get count of rows for a table and secondly, how can i have access to a particular cell in a table?
    Regards,
    Devashish

    Hi Devashish,
    WdContext.node<Your_node_name>().size() will give you the no: of rows.
    This should be the node that is bound to the table's datasource property.
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value); will select the row at that particular index.
    You can access an attribute of a particular row as
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value).get<attribute_name>();
    Hope this helps,
    Best Regards,
    Nibu.
    Message was edited by: Nibu Wilson

  • How to insert the select query result into table?

    How to insert the select query result into table?
    SELECT  top 20 creation_time  
            ,last_execution_time 
            ,total_physical_reads
            ,total_logical_reads  
            ,total_logical_writes
            , execution_count 
            , total_worker_time
            , total_elapsed_time 
            , total_elapsed_time / execution_count avg_elapsed_time
            ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
             ((CASE statement_end_offset 
              WHEN -1 THEN DATALENGTH(st.text)
              ELSE qs.statement_end_offset END 
                - qs.statement_start_offset)/2) + 1) AS statement_text
    FROM sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
    ORDER BY total_elapsed_time / execution_count DESC;
    Thanks,
    Tirumala

    1. SELECT INTO
    Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
    Use AdventureWorks2008R2;
    Go
    ---Insert data using SELECT INTO
    SELECT AddressLine1, City
    INTO BothellAddresses
    FROM Person.Address
    where City = 'Bothell';
    GO
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    2. INSERT INTO SELECT
    Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
    another table.
    Use AdventureWorks2008R2;
    Go
    ---Create Table
    CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
    ---Insert into above table using SELECT
    INSERT INTO BothellAddresses(AddressLine1, City)
    SELECT AddressLine1, City
    FROM Person.Address
    where City = 'Bothell';
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • How to Insert a record in a database table in debugging mode in production

    Hi,
    How to Insert a record in a database table in debugging mode in production ?
    Waiting for kind response.
    Best Regards,
    Padhy
    Moderator Message : Duplicate post locked.
    Moderator message : Warning. Don't create multiple threads for same question.
    Edited by: Vinod Kumar on May 12, 2011 11:02 AM
    Edited by: Vinod Kumar on May 12, 2011 11:04 AM

    Hi Senthil,
    Regards,
    Phani Raj Kallur
    Message was edited by: Phani Raj Kallur

  • How to insert an empty row on a matrix with multiple loaded lines?

    Hi.
    I want to insert an empty row on my form's matrix. Currently I am using the <b>AddRow </b>method, as it is:
    // C# - it's mandatory to give parameters to the method (=
    oMatrix.AddRow(1,1)
    But, when the matrix already has some rows (at least 1), the method <b>AddRow </b>inserts the new line as a copy of above line, then, I have to manually clear all cells.
    Any idea on this?
    Thanks in advance.

    If you matrix is bound to a dbDatasource you can insert a record in the dbdataspurce instead of using matrix.AddRow... If not only way to do it is by clearing the row after add

Maybe you are looking for

  • Inserting Rows in a QueryDataSet

    I use Oracle JDeveloper 1.1. When i try to insert a DataRow in a QueryDataSet, works al lfine, bute the DataRow is at the end of the DataSet. I need a methode to insert a DataRow an the top of the QueryDataSet. Is there any way? Thnks for help.

  • Ipod touch 2G: All App crash

    This just happened couple days ago when I noticed that all my apps crash. The only apps that doesn't crash are the App store, mail, music, safari...etc. But the other app such as games crash right away when I click on it. The only way I can solve the

  • Have a Droid, The beta is crash right and left. Rotating screen, using screen keyboard. What do you need for me to help fix it?

    Unable to use this browse as is on this device. I am not sure how to support debugging these issues.

  • HELP!!!! Moving Itunes library to External HD.

    I want to move the files from my packed machine HD. I have followed steps provided by Apple support, but the files have not loaded back into my ITunes. I currently have the files on the original C: drive AND my new external (F:) drive. I just receive

  • Include File doesnt work with URLs

    Hi guys, Im using <jsp:include page="/topper.htm" flush="true"/> to include topper. Can i use the full URL ex <jsp:include page="http://www.hotelrooms2bid.com/topper.htm" flush="true"/>. Since the topper and footer will come from different Web Server