How to capture number of tabular form rows in javascript

Greetings All -
I have a tabular form that I created manually.
I am looking for a way in javascript to capture the number of rows that are displayed on the page.
Is this possible?
Regards,
Mark

Bill -
Thank you for the reply.
I had thought of your suggestion but I was unsure where I could execute the apex_application.g_fxx.count command without submitting the page.
I cannot do this on a submit, because I need to now the number of rows displayed in order to do a calculation while entering a row on a manually created tabular form
Suggestions appreciated
Regards,
Mark

Similar Messages

  • How to avoid submitting a page when tabular form rows are empty

    Hi,
    I have a master detail form in my application. There are 2 tables that are used Table A and Table B. Table A contains Ticket number and Table B refers to Table A through a foriegn key and Table B have columns like Date,Name, Age, ticket_id (that refers to the ticket_number of the Table A).
    This is how the application works:
    In a page there is a field for Ticket Number, once the user enters the Ticket Number and click Add Details, a tabular Form with 5 empty field appears... (Done through Page Process->Data Manipilation->Add Rows)
    This form contains fields Date, Name and Age. Once the user fills in all the details and click Submit button, the page is submitted. Whatever values that was entered is saved in Table B. Page Sucess message appears. This works fine.
    But once the Ticket Number is entered and Add Details is clicked, and without entering the values in the Tabular Form, if Submit button is clicked, there is no error showing up neither I see Page success message. But this should not be allowed. There should be some error showing up...
    Tabular Form Validations works only when user enters some values in the Tabular Form and click Submit. For the above scenario, where the form is untouched the validation doesnt work.
    How can I get this done? Any ideas?

    Hello Suzi,
    >> if (document.wwv_flow==null)
    The document.wwv_flow is an object representing the current form that was just rendered on your screen. As such, it can never be null.
    >> How to avoid submitting a page when tabular form rows are empty
    The correct way, especially for versions prior to APEX 4.0 is to use JavaScript, but for that, you need to know and understand how APEX generates your tabular form, HTML wise.
    To be very brief, APEX attached a unique ID to every updatable cell in the tabular form, using a certain pattern – each updatable column is getting a unique name (e.g. ‘f01’,’f02’ etc.) and the ID of a cell is a combination of this name with the serial row number the cell is on. For example, a cell on the third row in an updatable column called ‘f04’ will be given an ID of f04_0003. (More detailed explanation, with an example, can be found in my book).
    What you should do is to check these cells according to your validation policy (e.g. is all five row must be filled, is all the columns in a specific row must be filled, etc.).
    Regards,
    Arie.
    ♦ Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    ♦ Author of Oracle Application Express 3.2 – The Essentials and More

  • Popup window for tabular form row edition

    To edit existing or new rows in a tabular form (page 1), I would like to open a popup window (page 2) with fields mirroring original tabular form fields. So, some basic data can be viewed/typed in the tabular form and the whole of the record data are viewed/typed on a separate popup form.
    On opening popup, I pass a tabular form's current line number (filled with up to three zeros on the left).
    When the user clicks on OK button on popup page, data will be put to the corresponding tabular form row. That should allow me to get /set tab form data from popup using following syntax:
    opener.document.getElementById('f04_' + line).value
    However, when I call data-initialization javascript function on onload of the popup form, popup fields to be filled are not rendered yet. At which point (and how) could I call this javascript initialization function?
    Another question. With Firebug Inspector, I see that right in front of each tab form data tag, there is a "label" tag with the name of the column as it was defined in report attributes. As long as I have a information, opener.document.getElementById, what HTML/Javascript syntax should I use to get to this label tag?
    Igor

    OK, the first part of question is OK now. Simply, I was putting a javascript code calling my initialization predure in the HTML Body Attribute section of the page, instead of simply writing there: onload="initFunction();"
    The second one stands still: once I have a tabular form's element id like f20_0003, how can I get to the symbolic name, e.g., "FIRST_NAME", that is in the label tag in the same table cell?

  • Export tabular form contents to javascript array

    How is it possible to export the contents of a tabular form to an javascript or a visual basic script array?

    If FOO is one of the column headers in the tabular form
    var th=html_GetElement('FOO'); // Gets the DOM node for the TH
    var t=html_CascadeUpTill(th,'TABLE'); // Gets the DOM node for the TABLE
    for (var j=1;j<t.rows.length;j++) {
      var l_row=t.rows[j];
      for (var k=0;k<l_rows.cells.length;k++) {
        // Do whatever with the TD node at l_row.cells[k]
    }

  • OnClick Event on Standard Report/Tabular Form Row

    Hi All
    We have complex requirements and would need your help here.In the Application( referred below on OTN), we need the following:
    Whenever User clicks anywhere on any row, the values in the Disabled Text fields(or we may chnage to disabled Text Areas if required) in the region at the bottom should come from the corresponding columns of the Row clicked. e.g. When User clicks anywhere on the row with Empid as 1, the disabled text fields should show Empname as "Ravijeet" and Departmentname as "Coprorate Application".
    Application Reference:
    URL: [http://apex.oracle.com/pls/otn/f?p=12190:3]
    workspace: VCS
    Userid: *************
    password: ***************
    Please let us know.
    Regards
    Ravijeet
    Edited by: Ravijeet on Jan 26, 2009 10:02 AM

    Hi Andy,
    Thanks again as usual for your valuable time and inputs, this too worked perfectly fine as usual :-)
    One thing I missed Yesterday :
    1) a) In all cases when ever the Page loads (or refreshes based on filter) the display items P3_EMPNAME
    & P3_DEPARTMENTNAME in the last bottom Region would have Values as per the First row of the Tabular
    Form, which we achieved yesterday.
    But in case we do 'SUBMIT' the page via "Submit" button to change value of salary field, the display items P3_EMPNAME & P3_DEPARTMENTNAME should have value as per the last row clicked i.e. in which salary value was changed.
    b) I am supposed to Focus the cursor by default on the salary field, which i tried to do using your reply
    on other thread : Tabular form - initially position the cursor on a given field
    Since we would not have to add any Row in tabular form so I removed the inner 'If' condition to setfocus always on first row's corresponding column (I saw certain problem in using arrow left and arrow right key,but this is minor problem).
    Extra requirement is that in case some other Row's Salary field has been changed and "submit" button is pressed then cursor should focus on the salary field of that row after submit.
    (like Displayed items in last region should be of row canged in case a above).
    We have few other really complex Requirements and have updated corresponding old threads on OTN (still open) :
    1) In the Tabular Form Users want to navigate in the "salary" field of our tabular form,
    use the Keyboard Keys "Arrow Up" or "Enter" to go to the salary field of the previous Row and "Arrow Down"
    to go to the salary field of the Next Row.
    Came across this thread, but could not get the complete code since would have to download complete ApexLib Framework:
    screen (behavior expected/required): http://apex.oracle.com/pls/otn/f?p=33231:52:4145765023028237::NO:::
    Thread: Use navigation keys in tabular form
    2) Scrollable Region with Constant Header would be also required, since in our case Tabular form would always have
    number of records more than can be displayed on one window screen.
    First I tried doing by putting in Tabular Report's Regions's Header: <div style="height:100px;overflow-y:scroll;">
    and footer : </div>
    This is the only change I did to our application on OTN, not to disturb it :-)
    As you see that as we drag the scroll bar below, column headers get hidden as they also move up.Requirement is to keep it constant.
    Went through the following thread discusses by so many People , but there is still no solution workable for all Browsers: How to implement fixed column headers
    Applied the solution provided for all browsers as per the thread,Column headers get really distorted.
    Users & I Prefer to have Scrollable region rather then having Pagination links (Noticed yesterday
    on my local application that in case we put pagination link our Java script to hide the extra columns in tabular report
    like 'XXX' OR 'Department Name' fails,which we grab to display in last region's displayed items, become visible).
    I know its more than enough questions on this thread. The thread is well answered by You with
    multiple correct solutions as per my all questions till now, but users Requirement Need all of these.
    I also know that if these are possible in APEX ,You would have the best idea.
    Have also updated the other threads ,mentioned above.
    Please suggest, if these would be possible?
    Many Thanks again as usual for all your valuable time and solutions provided.
    Regards
    Ravijeet

  • Is there a way to open page with a new Tabular Form row?

    Hi All,
    I have a (non-manual) Tabular Form that works great. My requirement is to have the new page to open with a new row already added.
    I tried      onLoad="onLoadProcess()";
         <script language="JavaScript" type="text/javascript">
         function onLoadProcess(){
         doSubmit('ADD');
         </script>
    but it hits every onload so it loops, each submit causing another submit.
    Anyway of getting the rowcount in the tabular form without making a manual one?
    Thanks, Bill

    Bill,
    Here's a short (hah!) example of how to do it with a manual form. No idea of how hard it may be to convert to a wizard form.
    select
    x.PERSON_ID,
    x.ck ck,
    x.PERSON_ROLE,
    x.del
    from (
    SELECT
    apex_item.select_list_from_lov(1,person_id,'PEOPLE') PERSON_ID,
    apex_item.hidden(2,issue_id)||
    apex_item.hidden(3,wwv_flow_item.md5(person_id,issue_id,person_role)) ck,
    apex_item.select_list_from_lov(4,person_role,'ROLES') PERSON_ROLE,
    apex_item.checkbox(5,person_id||issue_id) del
    FROM HT_ASSIGNMENTS
    WHERE ISSUE_ID = :P7_ISSUE_ID
    union all
    select apex_item.select_list_from_lov(1,NULL,'PEOPLE') PERSON_ID,
    apex_item.hidden(2,to_number(:P7_ISSUE_ID))||
    apex_item.hidden(3,null) ck,
    apex_item.select_list_from_lov(4,NULL,'ROLES') PERSON_ROLE,
    apex_item.checkbox(5,null) del
    from dual) x
    Bill Ferguson
    Message was edited by:
    wbfergus

  • How to fetch the value of tabular form item in javascript

    Hello all
    I want to do some calculations on the value entered by the user in the textfield of a tabular form, how can I fetch the value of tabular form item in the javascript?
    I am using normal tabular form, not using apex_item tabular form.
    I can pass the current textfield value to the function using "this" as a parameter, but how can I fetch the value of other rows of that same column?
    Thanks
    Tauceef

    Hi Alistair
    jQuery is still not working, but I got it done through some other means, this is the code:
    function total(pThis){
    var l_Row = html_CascadeUpTill(pThis,'TR');
    var l_Table = l_Row.parentNode;
    var l_Row_next = l_Row;
    var n_rows = l_Table.rows;
    var lInputs;
    var v1;
    var sum = 0.0;
    var temp;
    var i = 0;
    var j = 0;
    //alert(n_rows.length);
    while(j < (n_rows.length - 1))
    temp = 0;
    if(l_Row_next != null){
    lInputs = html_Return_Form_Items(l_Row_next,'TEXT');
    v1 = lInputs[0].value;
    //alert(v1);
    sum = parseFloat(sum) + parseFloat(v1);
    l_Row_next = l_Row_next.nextSibling;
    temp = 1;
    if(temp == 0){
    l_Row_next = l_Table.getElementsByTagName('TR')[1];
    lInputs = html_Return_Form_Items(l_Row_next,'TEXT');
    v1 = lInputs[0].value;
    sum = parseFloat(sum) + parseFloat(v1);
    l_Row_next = l_Row_next.nextSibling;
    j= j+1;
    $x('P78_TOTAL').value= parseFloat(sum);
    I am calling this function onblur event of the textfield.
    Still I am having one problem, I want to perform this calculation on load of the page also, how can I do that? because while calling onblur of the textfield I can pass that textfield to this function but on onLoad how I will pass the textfield to call this function so that I will be able to get the textfield value in the function?
    there may be some rows already existing, so I want the total of the existing rows to be displayed in my P78_TOTAL textfield that is why I need to do this calculation on onLoad of the page.
    Thanks
    Tauceef
    Edited by: Tauceef on Jul 8, 2010 4:57 AM

  • How to create a manual tabular form with DELETE capability

    Since the wizard tabular form does not allow the use of checkboxes, I am building my tabular form manually following the HOW-TO document. I will need to be able to delete rows in the form in addition to inserting and updating. Is there a document somewhere that describes how to do this? The how-to doesn't cover it and I have searched the forums to no avail.
    Thanks.
    Darin

    To create dynamic checkbox you can do the following:
    SELECT HTMLDB_ITEM.CHECKBOX(1,"your database field name", 'unchecked or checked') " "
    FROM YOUR_TABLE_NAME OR DUAL;
    ...then...
    In order to extrapolate the checkbox value you use following array:
    htmldb_application.g_f01("subscript value)"
    This array will contain value of checkbox. At this point you can do this:
    if htmldb_application.g_f01("subscript value)" = 'Y'
    THEN
    INSERT DATA...
    DELETE DATA...
    END IF;
    Hope this somewhat helps...
    NOTE: I have entered a lot of pseudo values/code but I believe you can fill in the blanks for what you need.

  • How can I use two tabular forms on the same page.

    I have create one tabular form in page and try to create second tabular form so
    it gives below error.
    1 error has occurred Updatable SQL Query already exists on page XXXXX.
    You can only add one updatable SQL query per page. Select a different page.

    I can get this to work but the page is submitted, either when I use a button with URL link or from a link on a display only text field.
    Is this how it is supposed to work? I thought it was supposed to work just on the browser so it is fast.
    IGNORE THIS!
    =============================
    I resolved it easily by modifying the URL from f?p=blah blah to #LINK_NAME
    Message was edited by:
    user530800

  • How do I Create a Tabular Form for an Intersection Table

    Situation
    There are three tables involved (PROJECT, STAFF, TASK)
    PROJECT(PROJECT_ID, PROJECT_NAME)
    STAFF(STAFF_ID, STAFF_NAME)
    TASK(PROJECT_ID, STAFF_ID, HOURS)
    There is a many to many relationship between PROJECT and STAFF. The intersection table is TASK.
    Issue
    I would like to create a tabular form for the TASK table. I would like to be able to click on a button (Add Row) to add a row to the existing tabular form. The row will have a LOV for the PROJECT_ID (showing PROJECT_NAME) and one for the STAFF_ID (showing STAFF_NAME) and a free form text field for the hours.
    I've tried a bunch of different ways but am unable to acheive this functionality. I must be doing something wrong. This sort of thing is trivial.
    Any guidance/suggestions are greatly appreciated.
    Thanks

    Adding a new surrogate key column to an existing table is not that big a deal.
    alter table t add (pk int primary key);
    create a before-insert row-level trigger to populate the key;Other than that, you are out of luck w.r.t the wizards. Yes, you can define a 2nd PK column in the wizard, but then the 2 PK columns becomes read-only (but you want to update them).
    You can write your own tabular form using htmldb_item APIs and your own after submit processes to process the updates. See the manual Tabular Form Howto in the documentation.
    Thanks

  • How to set a default tabular form value?

    I am trying to set a default value for a tabular form.
    In Tabular Form Element:
    ========================
    Display as: Date Picker
    Formet: Date Picker (DD-MON-RR)
    Default Type: Item (application or page item name)
    Default P2_DATE
    My item P2_DATE is set as:
    ==========================
    Date Picker (DD-MON-RR)
    However when I try to add a row with a default date I get this error:
    report error:
    ORA-01790: expression must have same datatype as corresponding expression
    Any ideas?
    Regards,
    Pawel.

    Sorry for spamming but found a solution:
    which was to change the type into PL/SQL Expression like so:
    to_date(:P301_PROJECT_XFR_DATE,'DD/MM/YYYY')
    This is the format I used in P2_DATE...
    Regards.

  • Tabular form row order out of sync when using apex_item.popup_from_query

    Hi
    I have a tabular form that contains a apex_item.popup_from_query column, the query itself has an order by clause and I believe this is the reason why selecting from the popup column results in the wrong row being updated.
    I refer to a previous post where Scott Spendolini acknowledges the absence of any workaround for this, does anyone know of one now given that that was a few years ago?
    I kind of need to find a workaround for this ASAP or else I will have to redesign the whole page and abandon the tabular form, I'd be really grateful for any help here
    Thanks

    I experienced the same problem before and there is definitelly a bug. However, I didn't know about this difference. This explains some doubts I had. Thanks for pointing that out. Hopefully, this is going to get better in 4.0.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How to set maxWidth in tabular form Text Field

    Text Fields do not have maxWidth property in tabular forms. Is there any way to set maxWidth using the Element Attributes field? Or at least create a Validation process to let the user know why an error appears if he/she enters more than the allowed characters in a text field.
    Thanks
    Francisco.

    >>
    This information should appear in the user'smanual.
    Francisco.There should be a working MAXLENGTH attribute that
    defaults to the correct length based on the data
    dictionary.Hi,
    been trawling through the forums for the same problem, found this solution which works a treat (thanks! ). But agree that the software should actually allow you to define this anyway, rather than bodge, fool, amend, bridge or circumnagivate (sp?) the software.

  • How to Capture Commit Point in Forms

    Dear Members,
    We are on E-Business Suite 11.5.10.2.
    We are trying to change the behavior of AP Invoice Work Bench form through CUSTOM.pll.
    When you try to reverse an existing distribution line, then oracle does a lot of validations and many triggers are fired until commit occurs.
    I turned on custom events and found WHEN-VALIDATE-RECORD trigger fires 14 times until commit occurs at the end.
    MY question is how can we know the commit occurred. I mean in custom.pll i need to write some logic where i need to take some field values in a block at the very end when commit occurs. The field values that i am talking about keep changing from the start to the end and i want to capture the values at the point commit occurs,
    Is there any means to know that commit occurred; so that i can retrieve values at that moment.
    Thanks
    Sandeep

    Try to debug the Block_status for line.I will regularly change from change mode to some mode for commit.

  • GP - CAF : How to capture data from impersonalized form.

    Hi All,
              I have a requirement where in I have submit the data offline using an Adobe form and this data should be fed to an RFC any no if times.
    I have created a interactive callable object (Impersonalized form) using a form template. I'm able to download the form and submit any no of times.
    But the problem I have here is: I do not see any way to capture the data from the form and input it to the RFC. Please let me know if any of you have any ideas.
    Version: Netweaver 2004s SP15
    Thank you,
    Vasu Mullapudi

    I got the solution.
    GP Process in design mode have a tab Forms. Here, we can add the Interactive form callable object (Impersonalised form) and can map the fields to the process context.
    Thats it. Whenever you submit the form, the process is run with the form data and the job is done.
    Note: If the data is not sent to the process, try from the callable object in design mode -> Configuration tab.
    Here while selecting the Start process Upon completion, you have a option for mapping fields.
    Thank you,
    Vasu

Maybe you are looking for