Adding new row at top of tabular form In APEX 4.0

I havea tabular form and when addrow() it is adding at bottom of the existing rows. Is there a way I can add new row at the top of the rows?
Thanks.
Edited by: Badari on Oct 19, 2011 12:07 PM

Hi Raj,
I'm trying to implement your solution to add the empty row of a tabular report to the top of the page but I can't get it to work. I've identified two errors in your code, namely
1) semi-colon after mytable.moveRow(mytable.rows.length-2,1) is missing
2) You say to use "ABC_REPORT" as the region id but you use "report_ABC_REPORT" in the code.
I've fixed these but still I cannot get it to work.
Could you check the code again and see if there are any other errors that we may have missed.
thanks in advance
PaulP
<script language="JavaScript" type="text/javascript">
function addTop()
  addRow();
  var mytable=document.getElementById("report_ABC_REPORT");
  mytable.moveRow(mytable.rows.length-2,1) // depending on the report template selected use either length-2 or length-1
</script>

Similar Messages

  • Query for create manual tabular form using apex collection add row button functionality

    Hello everyone
    My requirement is i created a tabular form manually using apex collection but if i click on add row button then previously selected data refreshed and added new row in this form it is fine.but i don't want to refreshed previously selected data and click on add row button then add new row .how it is possible? plz help
    Thanks & Regards,
    Ujwala

    Ujwala
    Instead of starting a new thread with the same question as Query for create manual tabular form using apex collection add row button functionality.
    Could you answer the question about what you see while debug the javascript code.
    If you don't understand the question or have trouble debug javascript let us know.
    Nicolette

  • Can iOS Numbers copy formulas when adding new rows?

    iOS Numbers table add row is not copying previous cell formulas. Is this supported or not?
    I have a table with lots of columns and all of them have formulas. When I click at the lower left of the table to add a row, none of the new cells have the formulas. I have to manually go through every column and copy the formulas to the new row.
    This is not very practical if you're planning to use Numbers on the go with an iPad. In my case, I have to quickly get a new row ready as needed. I was hoping there is a preference setting somewhere like "copy formulas when adding new row".

    I had the same issue with the added twist that I wanted to reference the created cells in formulas in other sheets. This is what works for me:
    I use a form to enter data. The referenced sheet is set up like this:
    1     Name     Date     ServPayment    SalesPayment     Total
    2     Week1                                                                 =sum (ServPayment,SalesPayment)
    3                                                                                =sum (ServPayment,SalesPayment)
    4     TotWeek1                                                            =sum (Total2,Total3)
    "Total" sums the 2 Payments, TotWeek1 sums the totals.
    In the entry form I never add data to the empty line. In this example, I would start at "Week1" and tap the "+" to add a new form. This creates the line in the referenced sheet with my formulas. As I continue, I always start at the last entry I have made and tap "+".
    When I create a line that does not have the formula on either side, I do not get the formula.
    Hope this helps.

  • Null Pointer Exception When Adding New Row on Table

    Hello JheadStart Team
    I have used detail group with table layout , when I am clicking on AddRow button on detail table , I encounter NulllPointer Exception . I have traced the code and fount that in JhsCollectionModel when adding new row following
    condition occurs :
    DCIteratorBinding ib = getRangeBinding().getIteratorBinding();
    int rangeSize = ib.getRangeSize();
    int rowsInRange = ib.getAllRowsInRange().length;
    because getAllRowsInRange is Null then the error raise.
    My JheadStart ver is 10.1.3.3.85 .
    Detail Group with table layout setting is :
    Use Table range=true
    Show New Row at top=true
    New Rows:empty
    Show Add New Row Button :true
    Regards

    Given the build you are using, I assume you are an Oracle employee.
    Is this correct? if so, please post your question to the [email protected] mailing list.
    Steven Davelaar,
    JHeadstart team.

  • EDIT method doesn't work after adding new row

    I would like to start editing after adding new row into TableView.
    I copied example from Oracle website: [Using JavaFX UI Controls - 13 Table View|http://docs.oracle.com/javafx/2/ui_controls/table-view.htm#CJAGDAHE]. Then I put additional button for adding new row and define action for the button.
        final Button addButton = new Button("Add");
        addButton.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent arg0) {
                Person p = new Person("", "", "");
                table.getItems().add(p);               
                table.getSelectionModel().select(p);
                table.edit(table.getSelectionModel().getSelectedIndex(), table.getColumns().get(2));
        });In result I can see selected new row but the table doesn't start edditing in the third column.
    I have similar method for editing existing rows and it works properly.
        final Button editButton = new Button("Edit");
        editButton.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent arg0) {
                table.edit(table.getSelectionModel().getSelectedIndex(), table.getColumns().get(2));
        });Could you help me what I do wrong?

    Try wrapping the setCaretPosition(...) method in a SwingUtilities.invokeLater(...)
    caret=outputArea.getDocument().getText(0,outputArea.getDocument().getLength()).length();Should be:
    caret = outputArea.getDocument().getLength();

  • How to refresh the grid so that default  values come on adding new row.

    Hi Experts,
    In alv grid while adding new row, i want some 2-3 column values to come by default from already existing row in grid.
    i am getting new row in internal table with 2-3 default values and rest columns blank on adding new row in alv grid
    but the entire row is coming blank, not able to get the default values in new row
    how can i refresh the grid so that default  values come on adding new row.
    thanks

    Hi Surabhi,
    Use this in Interactive section even if you are doing simple ALV.
    DATA:
    lv_ref_grid TYPE REF TO cl_gui_alv_grid.
    CLEAR : gv_tcode.
    *-- to ensure that only new processed data is displayed
    IF lv_ref_grid IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    e_grid = lv_ref_grid.
    ENDIF.
    IF NOT lv_ref_grid IS INITIAL.
    CALL METHOD lv_ref_grid->check_changed_data.
    ENDIF.
    THis will solve your problem.
    Regards,
    Vijay

  • Tabular Form - new row at top not working

    I'm trying to add a new row to the top of a tabular form (not manual) vs the bottom using Denes example - http://apex.oracle.com/pls/otn/f?p=31517:215 but it's not working. I absolutely need the records to sort on the date and time, but when I add a hidden column and sort it in descending order, then sort the date and time both in descending order, it doesn't sort correctly. I tried using the primary key field of the table as the hidden column, sorting nulls first, but the new record opens at the bottom (If I have "sorting nulls first" selected and at the time a new row is added the primary key field is null, why doesn't the new row open at the top?). I added a new field (date field with timestamp) to the query, then deselected "show" in the column attributes...that didn't work. I then selected "show", and changed the tabular form element display as to "Hidden", but then I got an error when I clicked "Add New", and I also added a column to my query via apex_item.hidden but no luck there either. What's the best way to go about this, but still maintain the date and time sort?
    Thank you,
    Tammy

    We did that. It didn't resolve it...
    Also, I compared the images directory from the complete apex 4.1.1. installation and compared it to patch 13331096 (latest 4.1.1 patch). They are identical.
    Any other ideas I can try out?

  • Tabular form - adding new row

    Hi,
    I have a very simple table (5 rows, 1 of which is the primary key), and want to update the table using a tabular form. On initial display, the primary key column is protected (cannot be changed) which is ok for DELETE and UPDATE options, but when I come to ADD A NEW ROW, the new row has NULL defaulted as the primary key value, and will not let me update it !!
    Does anyone know how I can leave the primary key column protected when UPDATING or DELETING, but allow a value to be entered when ADDING A NEW ROW ?
    thanks
    Tim

    Andy,
    Just made the following changes (to remove NARR1_CODE_DISPLAY and show and edit NARR1_CODE):
    select
    "NARR1_CODE",
    --"NARR1_CODE" NARR1_CODE_DISPLAY,
    "NARR1_LOWER_LIMIT",
    "NARR1_UPPER_LIMIT",
    "NARR1_RMP_MIDPOINT_1",
    "NARR1_RMP_MIDPOINT_2"
    from "#OWNER#"."DQ_PD_TRANS_DIST_BAND_NARR1"
    where the column NARR1_CODE is my primary id, and in the report attributes, NARR1_CODE is now editable and shown as a "text field" . NARR1_CODE_DISPLAY has been removed.
    However, when I go into my form screen, although the NARR1_CODE field is now editable, when I click ADD NEW ROW, enter the details for a new row, check the box alongside the new row and click SUBMIT, I get the following error message :
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "A884FA378C851786DDFE3A33709CB23C", item checksum = "F6395FDACE39D98E784F85C19D960620"., update "GRD_DD10_OWNER"."DQ_PD_TRANS_DIST_BAND_NARR1" set "NARR1_CODE" = :b1, "NARR1_LOWER_LIMIT" = :b2, "NARR1_UPPER_LIMIT" = :b3, "NARR1_RMP_MIDPOINT_1" = :b4, "NARR1_RMP_MIDPOINT_2" = :b5
    sorry about this !
    thanks

  • Add row in manually created tabular form

    Hi,
    I have created a manual tabular form in one of my pages, as I need 2 tabular forms.
    In my manual tabular form i have used collection, so while adding a row into it, the whole page get submitted.
    Do some have any idea how to add a row without refreshing the page, also kindly let me know all the steps for it, as I am new to Apex.
    Thanks,
    Rupak

    Hi Kiran,
    My code for tabular form is as below:
    SELECT apex_item.checkbox (40,
    seq_id,
    'onclick="highlight_row(this,' || seq_id || ')"',
    NULL,
    'f40_' || LPAD (seq_id, 4, '0')
    ) DELETE_CHECKBOX,
    APEX_ITEM.hidden (41, seq_id)
    ||
    APEX_ITEM.TEXTAREA (42,
    c001,
    5,
    80,
    'f42_' || LPAD (seq_id, 4, '0'),
    NULL) Major_Risks_Issues,
    APEX_ITEM.TEXTAREA (43,
    c002,
    5,
    80,
    'f43_' || LPAD (seq_id, 4, '0'),
    NULL) Mitigation_Plan_Action,
    APEX_ITEM.SELECT_LIST (44,
    c003,
    'Open;Open,Closed;Closed',
    'f44_' || LPAD (seq_id, 4, '0'),
    NULL) Status,
    APEX_ITEM.hidden (45,
    c004,
    'f45_' || LPAD (seq_id, 4, '0'),
    NULL) RISK_ID
    FROM apex_collections
    WHERE collection_name = 'COLLECTION_GT'
    UNION ALL
    SELECT apex_item.checkbox (40,
    NULL,
    'onclick="highlight_row(this,' || TO_NUMBER (9900 + LEVEL) || ')"',
    NULL,
    'f40_' || LPAD (9900 + LEVEL, 4, '0')
    ) DELETE_CHECKBOX,
    APEX_ITEM.hidden (41, NULL)
    ||
    APEX_ITEM.TEXTAREA (42,
    NULL,
    5,
    80,
    'f42_' || LPAD (9900 + LEVEL, 4, '0'),
    NULL) Major_Risks_Issues,
    APEX_ITEM.TEXTAREA (43,
    NULL,
    5,
    80,
    'f43_' || LPAD (9900 + LEVEL, 4, '0'),
    NULL) Mitigation_Plan_Action,
    APEX_ITEM.SELECT_LIST (44,
    NULL,
    'Open;Open,Closed;Closed',
    'f44_' || LPAD (9900 + LEVEL, 4, '0'),
    NULL) Status,
    APEX_ITEM.hidden (45,
    NULL,
    'f45_' ||LPAD (9900 + LEVEL, 4, '0'),
    NULL) RISK_ID
    FROM DUAL
    WHERE upper(:request) = 'ADD'
    CONNECT BY LEVEL = 1
    My Code for adding a row is as below:
    DECLARE
    vupdatecount NUMBER := 0;
    vinsertcount NUMBER := 0;
    BEGIN
    FOR ii IN 1 .. apex_application.g_f41.COUNT -- SEQ_ID
    LOOP
    -- if it's an existing record
    IF apex_application.g_f41(ii) IS NOT NULL -- contains SEQ_ID
    THEN
    apex_collection.update_member (p_collection_name => 'COLLECTION_GT',
    p_seq => apex_application.g_f41
    (ii),
    p_c001 => apex_application.g_f42
    (ii),
    p_c002 => apex_application.g_f43
    (ii),
    p_c003 => apex_application.g_f44
    (ii),
    p_c004 => apex_application.g_f45
    (ii)
    vupdatecount := vupdatecount + 1;
    ELSE
    apex_collection.add_member (p_collection_name => 'COLLECTION_GT',
    p_c001 => apex_application.g_f42
    (ii),
    p_c002 => apex_application.g_f43
    (ii),
    p_c003 => apex_application.g_f44
    (ii),
    p_c004 => apex_application.g_f45
    (ii)
    vinsertcount := vinsertcount + 1;
    END IF;
    END LOOP;
    END;
    Kindly look into this and let me know if any thing is wrong here.
    Regards
    Rupak

  • Adding new row in matrix

    Dear all,
    I press right-click on Journal Entry and select "Cancel" function.
    SAP B1 creates a new journal entry with inverted rows registration.
    Now, I added a new button in this form.
    When I press the button, I need to add a new empty row in the matrix.
    I use this command:
    oJEMatrix.AddRow()
    I also used this command:
    oJEMatrix.AddRow(1, 1)
    but what I obtain is a new row with the same values of the first row (it seems a duplication of the first row).
    The new row-index (first left column) in the matrix has the value "1" as the first original row.
    How can I add a new empty row in this matrix and refresh the matrix to update the index of each row?
    Best regards
         Emanuele

    I found the error:
    I was trying to set Credit > 0 and Debit > 0 on the same row.
    But now I have a nother issue with matrix.
    See image below...
    After populating the matrix, the rows index are incorrect. How can refresh the matrix to recalculate the correct row number in the first column?
    Best regards
        Emanuele

  • How to hide and show button based on if row is selected in tabular form

    Hi,
    Im pretty new to apex. I am using version 4.1. I have a tabular form and what i want to do is only have the delete button show if i select a row from the [row selector] column. Can this be done using a dynamic action? I have tried it that way unsuccessfully. Please help or let me know if you need any more information.
    Thanks

    Do you mean if the check box is selected in the row?
    Assign a static ID to the delete button, e.g. MY_DEL_BTN. Look for "Static ID" under the Attributes section of the button.
    If so, make an advanced Dynamic Action based on Click and a jQuery selector. Usually, this element is name "f01" but, you need to make sure. Assuming it is "f01" then your jquery selector would be:
    input[name="f01"]set the event scope to live.
    Your dynamic action will fire JavaScript. (BE SURE TO UNSELECT FIRE ON PAGE LOAD). To make sure you have the right jQuery selector, at first just put a pop up message in the JavaScript.
    alert('You Clicked the Row Selector!');Run the page. Click the row selector. If you get the pop up you have specified the jQuery selector correctly. Yay!
    Then, assuming the above is correct. You can now determine if any have been selected.
    Now, set it back to SELECT TO FIRE ON PAGE LOAD (You want the delete to be hidden when you first open the page).
    Change your JavaScript to this:
    var checkedCnt = $("input:checked").length;
    if( checkedCnt > 0 )
       $('#MY_DEL_BTN').show();
    else
       $('#MY_DEL_BTN').hide();
    };-Joe

  • How to identify rows to update on tabular form?

    Application Express 3.2.1.00.10
    Hello!
    I have a tabular form in my application that I created through the wizard. The form is based on a table with a primary key and a trigger to populate the next key upon insert, so as a result going through the wizard was not a problem. It created page processes for ApplyMRU, ApplyMRD, AddRows, etc. I'm curious how APEX knows which row is updated without the user having to select the checkbox and clicking Submit. It seems the checkbox is only for cases where the user wants to delete a record.
    I want to be able to replicate this in another tabular form page which I am manually creating, although it will be based on a view without a PK (which I had to "fake" by concatenating unique identifying columns). In this form page, when I make attempt to make an update to a record, nothing happens in the database, unless I actually check a checkbox and click on Submit. How do I get around having the user to click off records to update? I want the form to just accept changes, and "know" which records to update in the table, similar to how APEX does it out of the box.
    Any ideas? Thanks!

    Denes,
    I tried as you have suggested, but for some reason, it doesn't seem that any action is taking place. Either the column arrays are empty or apex_application.g_f01(i) does not have a value. I've verified that none of the records in the database have changed. Any ideas?
    The Process Success Message is set to:
    Changes successful. &P7_REC_UPDATE_COUNT. records updated.  &P7_REC_INSERT_COUNT. records inserted. ... and it shows Changes successful. 0 records updated. 0 records inserted.
    This is the Page Process executed on submit of the "Submit" button:
    DECLARE
      v_return  NUMBER;
      v_msgcode NUMBER;
      v_message VARCHAR2(250);
      v_row     BINARY_INTEGER;
      v_insert_cnt INTEGER := 0;
      v_update_cnt INTEGER := 0;
    BEGIN
       FOR i IN 1..apex_application.g_f01.COUNT  LOOP
          IF  apex_application.g_f10(i) IS NOT NULL             -- CHECKSUM FIELD
             AND wwv_flow_item.md5 (apex_application.g_f01(i),   -- PK_COLUMNS
                                    apex_application.g_f05(i),   -- org_code
                                    apex_application.g_f07(i),   -- access_flag
                                    apex_application.g_f08(i),   -- external_flag
                                    apex_application.g_f09(i)   -- confid_ind
                                   ) != apex_application.g_f10(i)
          THEN
          ROLLBACK;
          RAISE_APPLICATION_ERROR(-20001,'Current version of data in database has changed '||
                                   'since user initiated update process.');                      
          RETURN;
        END IF;
      END LOOP;
      FOR i IN 1..apex_application.g_f01.COUNT LOOP
       IF apex_application.g_f01(i) IS NOT NULL THEN
         -- update existing record if PK value exists
         USER_SEC_UPDATE (I_ACTION        => 'U',
                          I_WK            => apex_application.g_f02(i),
                          I_USER_ID       => apex_application.g_f03(i),
                          I_ORG_CODE      => apex_application.g_f05(i),
                          I_ACCESS_FLAG   => apex_application.g_f07(i),
                          I_EXTERNAL_FLAG => apex_application.g_f08(i),
                          I_RPT_LEVEL     => NULL,
                          I_CONFID_IND    => apex_application.g_f09(i),
                          O_RETURN        => v_return,
                          O_MSGCODE       => v_msgcode,
                          O_MESSAGE       => v_message);   
         v_update_cnt := v_update_cnt + 1;
       ELSE
         -- insert new record if PK value doesn't exist
         USER_SEC_UPDATE (I_ACTION        => 'I',
                          I_WK            => NULL,
                          I_USER_ID       => apex_application.g_f03(i),
                          I_ORG_CODE      => apex_application.g_f05(i),
                          I_ACCESS_FLAG   => apex_application.g_f07(i),
                          I_EXTERNAL_FLAG => apex_application.g_f08(i),
                          I_RPT_LEVEL     => NULL,
                          I_CONFID_IND    => apex_application.g_f09(i),
                          O_RETURN        => v_return,
                          O_MSGCODE       => v_msgcode,
                          O_MESSAGE       => v_message);   
         v_insert_cnt := v_insert_cnt + 1;              
       END IF;
      END LOOP;
      :P7_REC_UPDATE_COUNT :=  v_update_cnt;
      :P7_REC_INSERT_COUNT :=  v_insert_cnt;
    END;

  • Adding new row to the reports list page

    How can I add a new report row in the reports list of the reports tab.
    Ex: a new row to the report "users by Date of Join report" is to be added
    How can we add Please help me out in this

    I am facing the same problem!
    camickr wrote:
    Try adding an empty row containing a null value for the String instead of the empty String.camickr, it will not help, the DefaultRowSorter in the "*+compare(int model1, int model2)+*" method return -1 if the first value is null and 1 if the sacond value is null. and incase of DESCENDING it mult by -1.
                    // Treat nulls as < then non-null
                    if (v1 == null) {
                        if (v2 == null) {
                            result = 0;
                        } else {
                            result = -1;
                    } else if (v2 == null) {
                        result = 1;
                    } else {
                        result = sortComparators[counter].compare(v1, v2);
                    if (sortOrder == SortOrder.DESCENDING) {
                        result *= -1;
                    }And this is the real problem!
    The empty line is sorted as the smallest value and incase of DESCENDING it will be the first line (because of the mult by -1).
    We could have overide it and incase of the empty row(usualy the last row) do not mult by -1 in DESCENDING mode.
    But the problem is that the "+*compare*+" method and it's caller "*+Row+*" inner class are private :-(
    It is not wise to do it but we can do like kmp83 wrote:
    kmp83  wrote:
    copy/duplicate "private" code from DefaultRowSorter into my extended class.Anyone have another suggestion?

  • Keep coursor position row number 5 in tabular forms.

    Hi all,
    I am facing some problem , In tabular forms there are around 10 rows.
    I want to keep cursor position in number 5 position. Data moves up and down by pressing up and down key but always cursor remain in 5th position. I think u get my point.
    Thanks,
    Md.Muniruzzaman Khan
    Email : [email protected]

    Ok it may not exactly what you want but it's really close.
    put on your block a hey-up and key-down trigger with the following code
    declare
         counter NUMBER(10);
    begin
    if :system.cursor_record < 5 then
         go_record(5);
    else
         -- suppose you have 10 records displayed you can make it dynamic by retrieving the block's displayed record and round(num/2)
         -- instead of the fixed 5
         SCROLL_DOWN;
         counter := :system.cursor_record;
         go_record(counter+5);
    end if;
    end;
    hope you can do something with this

  • Show new rows at top. Is it possible?

    Hi all,
    I am using Java Studio Creator 1 � Update 2.
    When the user is allowed to insert new records in a table one or more empty record will be visible at the bottom of the table. And the user can then simply enter the new data in theses empty records.
    How can I determine where the new rows will be placed? Actually they will be at last page of a table view. Is it possible to show news rows at the top of the table?
    Thank you
    Pablo de Souza C�mara

    Hi all,
    I am using Java Studio Creator 1 � Update 2.
    When the user is allowed to insert new records in a table one or more empty record will be visible at the bottom of the table. And the user can then simply enter the new data in theses empty records.
    How can I determine where the new rows will be placed? Actually they will be at last page of a table view. Is it possible to show news rows at the top of the table?
    Thank you
    Pablo de Souza C�mara

Maybe you are looking for

  • Project Code for Variables

    Hello All, I am able to use Variables in procedures and open tools ,interfaces etc. Variables #VariableName works well. But I was reading that the standard is to use #ProjectCode.VariableName . Whenever we try to use #ProjectCode.VariableName our pro

  • Problem creating Billing Doc  VF01

    Hi,    I am trying to create a billing document and but it shows that the "Accounting Interface error" All the G/l accounts etc entries Have been maintained properly.

  • String with length 1 became 4 when nls_lang_semantics=CHAR

    Hi, We are using Oracle 9.2.0.1 database with charset = UTF-8, and we have set nls_lang_semantics=CHAR. We got a problem in our java program is that for a column with char(1), after I insert a java constant 'Y', the result I get back from select is a

  • Directed here to find a cooling performance diagnostic tool for my X205.

    Hi, I was looking for software to monitor and control the fans in my X205. I have an overheating problem when gaming. The vents are clear, and I have opened the case and cleaned it out. The vents are not blocked. This problem occurred recently. I ass

  • Command Line Build

    I'm trying to do a command line build for my project.  I have a main application, that uses a couple of libraries and there are about 10 modules. I can compile the main application using mxmlc, but when I try to compile the modules I get an error say