Clone Rows - Tabular form - Client side add rows

Hello all,
I feel in love with this particular Tabular form, http://htmldb.oracle.com/pls/otn/f?p=24317:49 because of the Capabilities it has to create a "clone row".
a very advance feature I like a lot.
The trouble is when I go under >Report> and select which columns I would like to view, some will be hidden with default values.
the default values I would like to keep hidden are: a Time Stamp, and :APP_USER.
So when the user decides to clone a row the first original row will stay intact with all the information including the hidden values, but as for the cloned rows the hidden values are missing.
Is there something missing in the javascript that permits this from happening?
Please Help.
<script type="text/javascript">
var g_this;
function fn_delete(pThis)
var l_tr=$x_UpTill(pThis,'TR');
l_tr.parentNode.removeChild(l_tr);
function fn_CloneRow(pThis){
g_this=pThis;
l_tr=$x_UpTill(pThis,'TR');
l_table=$x_UpTill(l_tr,'TABLE');
l_tbody=$x_UpTill(l_tr,'TBODY');
l_clone=l_tr.cloneNode(true);
html_RowHighlight(l_clone,"D0D0E0");
l_inputs=l_clone.getElementsByTagName('input');
for (var j=0;j<l_inputs.length;j++) {
l_this=l_inputs[j];
if (l_this.type=="hidden") l_this.value="";
if (l_this.name=="fcs") l_this.value="zzzz";
if (l_this.type=="checkbox") l_this.parentNode.removeChild(l_this);
// Change Clone functionality to Delete
var l_img=l_clone.getElementsByTagName('img')[0];
l_img.src="/i/delete.gif";
if (document.all) l_img.onclick=function(){fn_delete(this)};
else l_img.setAttribute("onclick","fn_delete(this)");
l_tbody.insertBefore(l_clone,l_tr.nextSibling?l_tr.nextSibling:l_tr);
</script>

I have't looked at the specific clone-row sample code you mentioned in your post, but just wanted to point out that we've introduced client-side add-row functionality in APEX 4.0, so if you're using this code to add new rows on the client-side, then using the built-in functionality might be easier. Of course if you actually want to get a copy of an existing row, that might not be sufficient. As for the MRU process, the way APEX identifies new rows is by looking at the primary key or ROWID column value, which needs to be NULL. APEX also looks at the apex_application.g_fcud array, which holds information for each row on whether to do an create, update or delete. This array was introduced in APEX 4.0, and that's what could potentially be causing your example to fail after the upgrade.
Regards,
Marc

Similar Messages

  • Tabular form - Client side Clone Row on apex 4.1 not work

    Hi all,
    j have a tabular form page where i have implemented Vika's clone row solution.
    (See http://htmldb.oracle.com/pls/otn/f?p=24317:49)
    Now, after migrating my application from Apex 3.2 to Apex 4.1 this feature not work.
    Clicking the Copy icon copies the row and puts it right below.
    Now, if I change some values in the new row and click Save, the MRU process updates does not insert the row in the database
    Apex 4.1
    rdbms 11.2.0.4
    win xp
    chrome browser
    Any help?
    Thanks in advance.
    lukx
    The "clone row" function is
    </script>
         <style type="text/css">
         img.clone {
         cursor:pointer;
         </style>
         <script type="text/javascript">
         var g_this;
         function fn_delete(pThis)
         var l_tr=$x_UpTill(pThis,'TR');
         l_tr.parentNode.removeChild(l_tr);
         function fn_CloneRow(pThis){
              g_this=pThis;
              l_tr=$x_UpTill(pThis,'TR');
              l_table=$x_UpTill(l_tr,'TABLE');
              l_tbody=$x_UpTill(l_tr,'TBODY');
              l_clone=l_tr.cloneNode(true);
              html_RowHighlight(l_clone,"pink");
              l_inputs=l_clone.getElementsByTagName('input');
              for (var j=0;j<l_inputs.length;j++) {
              l_this=l_inputs[j];
              if (l_this.type=="hidden") l_this.value="";
              if (l_this.name=="fcs") l_this.value="zzzz";
              if (l_this.type=="checkbox") l_this.parentNode.removeChild(l_this);
              // Change Clone functionality to Delete
              var l_img=l_clone.getElementsByTagName('img')[0];
              l_img.src="/i/delete.gif";
              if (document.all) l_img.onclick=function(){fn_delete(this)};
              else l_img.setAttribute("onclick","fn_delete(this)");
              l_tbody.insertBefore(l_clone,l_tr.nextSibling?l_tr.nextSibling:l_tr);
         </script>

    I have't looked at the specific clone-row sample code you mentioned in your post, but just wanted to point out that we've introduced client-side add-row functionality in APEX 4.0, so if you're using this code to add new rows on the client-side, then using the built-in functionality might be easier. Of course if you actually want to get a copy of an existing row, that might not be sufficient. As for the MRU process, the way APEX identifies new rows is by looking at the primary key or ROWID column value, which needs to be NULL. APEX also looks at the apex_application.g_fcud array, which holds information for each row on whether to do an create, update or delete. This array was introduced in APEX 4.0, and that's what could potentially be causing your example to fail after the upgrade.
    Regards,
    Marc

  • Forms client-side pl/sql procdures run in DB or Forms server?

    Hi,
    Does anyone know where Forms client-side pl/sql procdures and pll actually run?
    We plan to convert forms application to web-based application. We want to take out and re-use only business logic in forms procdure/pll and still want to keep them in pl/sql language.
    Our first option is to put the business logic as pl/sql stored procedures in DB server. But my clients worry about the DB server performance. My clients think that forms procedures run in forms server and moving them into DB server will result in additinal workload in DB server.
    Every body says that the best place to execute pl/sql is
    in the database. However if Forms client-side pl/sql procdures run in Forms server, is my client right?
    If so, does anybody know how to make pl/sql procedure in a client-side PL/SQL package and call it from other language (Java or else)?
    Hyunsu Kim

    Forms PL/SQL will run in the Forms Server - if y want to share business logic accross multiple applications you could put it onto the database as you mention. You won't know if performace will be good or bad until you do some tests but its a pretty common scenario - and remember - what you MAY lose in terms of slower processing because of load, you will gain by eliminating network transfers between the Forms server and the database.
    Regards
    Grant Ronald
    Forms Product Management

  • Tabular form - How to add a G_USER column?

    Hi All,
    I have a tabular form that shows records form a table. the form allows updates only, not inserts/deletes.
    I want to add a column to hold the user who last updated the record. I know I can use APEX_APPLICATION.G_USER function but I am not sure where to put it.
    I tried by creating a computation but it shows me only page items, since I am using tabular form the column is not a page item.
    Also, how can ensure to update only those rows who were actually updated by the user and not all rows that were displayed?
    Thanks

    Fabio,
    You can create a database trigger on the table, "when updating" ...
    :NEW.LAST_UPDATED_BY := nvl(v('APP_USER'), user);
    Scott

  • Tabular Form - want to add default to column

    Hi I have a Tabular Form with 5 columns. I have an Item as one default.. no problem.
    I want the default of another column to be the results from a PL/SQL Expression (as the available choice shows as being possible).
    or the result of a select statement:
    select count(*) +1 from my_table where x = :P3_id;
    Anyone know how I can do it?
    Thanks Bill

    Hi Scott,
    Haven't tried either because the selection of "Default Type" under "Tabular Form Element" has 3 choices:
    No Default
    Item (Application or Page Item Name)
    PL/SQL Expression or Function
    I selected PL/SQL Expression or Function but no textarea to write your PL/SQL block... or query...

  • ADD ROW in tabular form with new max value for a certain field

    All,
    I have a tabular form with an 'ADD ROW'-button.
    When a row is added the field 'TemplateID' should get
    automatically a new value which is MAX from TEMPLATEID + 1.
    I would be very glad, if someone has a hint for me.
    Thanks in advance,
    lucio

    Hi
    the cause of not seeing the 'Default Item Field' is,
    that during creation of a 'Tabular Form' the column with the
    primary key doesn't get that feature, why so ever.
    I still hope that someone could give me a hint why that code isn't working:
    function SetNewID(vDBID)
    v_check = $v('P20_MAX_TEMPLATEID');
    pNd = $u_Carray(vDBID);
         for(var i=0;i<pNd.length;i++){
              var node = $x(pNd);
              node = $x_Check_For_Compound(pNd[i])
              var lTr = $x_UpTill(node,'TR');
    updateRow = lTr.rowIndex - 1;
    document.wwv_flow.f02[updateRow].value=$v(v_check)
    Many thanks in advance
    lucio                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • ReadOnly columns on Tabular Forms (Javascript?)

    I have a question in regaurds to tabular forms. I have a tabular form set up, working perfectly. However, I want to be able to make certain columns readonly upon adding the new row (clicking new row button).
    Scenario:
    1) Go to tabular form
    2) Click add row
    3) Once the new row apppears, the columns should all be read only columns (i.e. cant type in them)
    4) Exception: There is one column, a select list, that shouldn't be readonly.
    5) Depending on which value is selected from the select list, determines which columns will be editable, or un-read-only.
    - The last step is merely a conditional. The part that is plaguing me is accessing the actual columns of the tabular form. I'm not too sure how to go about this. Would I even have to make changes to the actual AddRow() function itsself?
    Thanks for any help in advance
    sincerely, #StillLearningApexGuy

    wOW,..this example works perfectly. My javascript/jquery is a little rusty but I should be able to tweak the example for my needs.
    Thanks for the example. I am in your debt
    Sincerely #GreatfulApexGuy

  • Link for field in tabular form

    Hi everyone,
    How can you create add a link (which opens a pop up screen) next to a field in a tabular form, in order to set the value in that field with the value
    selected in the pop up screen.
    I already know how to set the values.
    In the tabular form when you add a link, you see the id and row also. How can I remove that or is there another way to set the values.
    Thanks,
    Cleo

    I think you can accomplish what you want by changing the the field to update from text to a popup lov. You can do this by going into the report attributes of the tabular form and then clicking the pencil next to the field who needs the lookup values. Change the 'display as' box from text to popup lov and supply the values.
    You can also hide fields by going into the report attributes and unchecking Show.
    There is an overview of some concepts here http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13363/frm_tabular.htm.
    Let me know if I'm not understanding your post correctly.

  • Insert a new record in the middle of a tabular form

    Hi,
    I have a tabular form.
    Pressing "Add Row" button opens a new, empty row at the bottom of the page or - if I use pagination - jumps to the page with the last record and creates a new record there.
    Is it possible to open a new line in the middle of the page ?
    I mean: if I have 25 records, I am on the first page (records 1-10) and the cursor is in a field of the second record and I press the "Add Row" button there should be a new, empty second line with old second record in the third line,... the old ninth record now in line 10 and disappeared record ten ?
    Any idea ?
    Thanks,
    Heinz

    Heinz,
    You may investigate logic using UNIONs and a manual tabular form.
    Something like:
    --get all records above new row
    select apex_item... column1
    ,apex_item... column2
    from yourtable
    where <logic to limit rows above new record>
    union
    --get the new row
    select apex_item... column1
    ,apex_item... column2
    from dual
    where :REQUEST = 'ADDROW'
    union
    --get every row not in the top query
    select apex_item... column1
    ,apex_item... column2
    from yourtable
    where <logic to pull all records not pulled above new record>
    For this to work you'll need to add your own "Add Row" button and associate it with a branch. Notice the select between the two unions in the above query is a select against dual. This will be your new record when pressing your "Add Row" button (:REQUEST = 'ADDROW').
    The following how-to link is a reference for some of the logic you'll need when creating a manual tabular form.
    http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html#MANUAL
    Good Luck,
    Todd

  • Can tabular form handle CLOB?

    Hey,
    I just came up the next problem: I have a tabular form with one column being a textarea with type CLOB, when i try to fill in text that is over 4000 then it gives me the next error:
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 6556, maximum: 4000
    I can't find anyone else with the same problem, Is it just me or is this not possible?
    Kind regards,
    Oli

    Nicolette wrote:
    Pars
    PARS wrote:
    Hi Nicolette,
    Yes i'm creating dynamic action on page load for add row but it create only one row
    In your javascript are you using a loop to run add_row as many times as needed?
    Somthing like
    l_no_rows = apex.item('P_YOUR_ITEM').get_value; 
    for (var i=0;i<l_no_rows;i++) 
    add_row; 
    Where P_YOUR_ITEM is a hidden item that holds the number of rows that need to be added.
    PARS wrote:
    it is possible by creating manual tabular form but it add row which are null not maps parent field reference
    If your using a manual tabular form than the default values have to be set by you the moment you create the new row.
    So either as parameter in apex_collection.add_member or as a value in the select statement.
    Nicolette
    Are you referring to apex internal add row js function? because there is nothing called add_row
    it is addRow and it should be called as below in the DA:
    addRow();

  • APEX 4.01 Tabular form with select list error

    When i create a tabular form and i add a select list(query based LOV) the form is not displayed but gives me the next error
    report error:
    ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    somebody have an idea what is happening here
    is this still a bug in APEX 4.01?
    hope to have an answer soon.
    Hugo Perfors

    Hi Jari,
    It returns about 1100 records which i think is not much.
    But even when i narrow the amount of records the problem is not solved.
    it this a bug?
    Best
    Hugo

  • ReRender using client-side dom id

    Is it possible to use client-side DOM ids for rerendering. I have noted that JSF/Richfaces only accepts server-side DOM names.
    e.g.
    <h:form id="myForm">
        <h:outputText id="testData" value="#{testAction.testData}" >
        <a4j:commandButton id="updateData" value="Update Data"
                                 action="#{testAction.updateData}" reRender="testData"/>
    </h:form>client-side DOM id: testData
    server-side DOM id: myForm:testData
    Is there some method on the server (maybe in rerender phase) that I call to achieve this i.e. reRender="myForm:testData"
    Thanks,
    Philip

    The problem that I've posted is just an example. The real jsf page is extremely complex which is made up repeating data that is nested multiple levels deep. I'm trying to minimize the amount of data being rerendered as the page is over 1.5MB in size as it stands, but still needs to be extremely interactive and responsive.
    The form lives within the repeating rich:dataGrid to minimize the amount of data being submitted to the server. In the real application this repeat is nested within a few other repeats multiple levels deep. I also use ajax regions to minimize the amount of processing on the server side.
    The problem I'm trying to solve is as follows:
    1) I have page with lots of repeating data multiple levels deep. At each data level content is represented in a set of panels/forms.
    2) Changing one value in one of the forms can initiate a complex set of events, where data needs to be rerendered in other areas outside the current form (but on the same page).
    3) The data across all these tables can be sorted by the end user, which means that I have lost the original link between the backing data and the client-DOM component i.e. if you sort data, the data changes its position, but the DOM components remain unchanged. This is problematic as I need to know down to a single field what needs to rerendered.
    The solution that I am trying to employ:
    1) As the page loads (or is subsequently rerendered on a post-back) I store a unique identifier (based on pk of the backing component - ejb entity) and the client dom id of the component back in a map on the server (pk to client dom map). I only need to do this for a select set of fields that I know might change during step 2 above. If one element is changed that causes a data change in another area of the screen, I can get to the client ID by doing a look up on pk/client dom map.
    2) I am using the ajaxKeys property combined with the field name to calculate the exact component that needs to be renrendered. However, to get at this I need to parse the client ID to figure out the ajaxKeys and field name. I then need to set these keys for every table that is a parent of the current field that I am trying to rerender. One issue that I am faced with using this approach is: if I need to update more than one field within the same rerender but is based on different ajaxKeys - still trying to figure this one out.
    This process would be so much easier if I could just tell JSF to rerender based on the set of client IDs that I know need to be rerendered.
    Thanks for the advice.
    Philip

  • Can't add row to sorted tabular form

    I have a very basic tabular form created using the wizard. The only significant change I made was to the sort order. When I click on the add row button, the new blank row is created at the top of the table. When the number of rows in the table grew beyond the page size (10), the blank row seems to be created at the top, but the form goes to the last page of data so the blank row is never displayed.
    If I remove the ordering then the blank row is added at the bottom and the automatic navigation to the last page shows the blank row.
    How can I modify this behaviour - either add the blank row at the end, or display the first page when adding rows.
    Table Structure
    dt_id (populated by trigger)
    dt_date
    dt_meal_type varchar2
    dt_food varchar2
    Sort order is (dt_date desc, dt_meal_type)
    Apex 2.1.0.00.39 on XE

    Vikas,
    I've had a look at your javascript idea. It took a little bit of figuring out but I think I understand it. I had to modify it a bit so that it cleared the values (I'm not trying to clone anything - I just want a blank record).
    After spending a whole morning on this I still have 2 fairly serious outstanding issues:
    a) When I enter some values into my new blank record and hit Submit nothing seems to be saved and the record just seems to get lost (I suspect I have cleared out some important hidden fields or something)
    b) It doesn't work if the table is blank and I am trying to enter the very first record.
    I'm sure it's possible to fix these issues but I am no javascript expert and I have come to the conclusion that it just isn't worth investing any more time.
    The benefit of Application Express to me is that it is a simple declarative development environment. There are many things I need to be concerned about and javascript just isn't one of them.
    Whilst I wait for the tabular forms functionality to mature, I think I will go back to the good old report + Edit button style.
    Thanks,
    Alastair
    PS. Here is the script I added to the region header (I removed everything I didn't understand and added it back in as and when I needed it):
    <script>
    function addRow()
    var col = html_GetElement('NAME'); // NAME is just an arbitrary column in my table
    var tab = html_CascadeUpTill(col,'TABLE');
    var row1 = tab.rows[1];
    var clone = row1.cloneNode(true);
    var elements = clone.getElementsByTagName('input');
    for (var j=0;j<elements.length;j++) elements[j].value="";
    myNewRow = tab.insertRow(tab.rows.length);
    myNewClone = myNewRow.replaceNode(clone);
    </script>

  • How can i add rows in a tabular form

    Hi,
    How can i add rows in a tabular form with out updating in database and after adding the rows one by one and after filling the data then iwant to submit them all at once.Please help me on this.
    Thanks

    Hello Leandro,
    In the Add_Rows page process, there is a box for "Number Of Rows". Change that value and you change the number of rows that get added. The default is 1.
    Don.
    You can reward this reply by marking it as either Helpful or Correct :)

  • How to add a new row in Tabular Form based on a table

    Hi
    I have tabular form based on a table.
    I want the table to have an empty row when there is no data
    in the table so that I can enter data directly.
    But right now whenever the page is launched, its showing a no data found message and I have to press the 'Add Row' button to enter data.
    Can anyone help me out on this?
    Thanks

    Hi Leo
    Your suggestion works fine in the APEX 2.1
    But in 3.0.1 it gives this error :
    Error in add row internal routine: ORA-01476: divisor is equal to zero
    Error Unable to add rows.
    I am not sure why this happens.

Maybe you are looking for

  • How can I delete Mt. lion and go back to Snow Leopard?

    I just installed Mt. lion and learned that I can no longer use Microsoft products (Excel and Word). These are MUST apps. How do I go back to Snow Leopard?

  • How do you add a link to a .swf file?

    Is there a way to add a link/URL to a .swf file, without embedding into the original .fla file? Is there any way to do that with just the .swf file alone, and without actually editing the .fla or re-creating it?

  • Iphone screen went black

    Randomly today, my iPhone 4 screen went black. I can receive calls and I see volume levels. Screen black.

  • Screen writting and icons englarged?

    In desperate need of some help please. My phone is locked, and it is impossible to enter the 4 digit password, as all the icons, and writting on the home page have somehow zoomed in? So how would I get rid of the zoom? thanks in advance

  • Extensions don't work.:(

    Hey everyone. We live in a new-build flat. It has the master socket downstairs near the front door (we live in a flat that has our own front door to outside and then stairs to our flat). We also have an extension downstairs near the front door and an