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

Similar Messages

  • How to get the value of a variable defined in javascript in JSP

    how to get the value of a variable defined in javascript in/through JSP????

    In Javascript you can use the DOM to access the input element and set it's value before submitting the form. Then it's value will just be passed.

  • How to fetch the customer debit balances form the KNC1 database table

    Hi Experts,
    I am creating a ABAP report which would dispaly the customer credit balances for the currenct fiscal year.
    I am fetching the values form KNC1 database table.....But in this table values are stored year wise.
    But I want to display for the current fiscal year that means if teh user selects the 07/2011 as the month on the sleection screen then the debit balances from 072010 to 062011 should be dispalyed.
    Could anyone please help me out to fetch this the debit balaces form KNC1 database table in the above format.
    Or is there any other way to solve this problem?
    Awating your urgent reply.
    Many Thanks,
    Komal.

    Hi Komal,
    First, you have to compute the initial period and the final period.
    Next, you must read table KNC1 for the years comprised between these two periods.
    Last, you must read the fields of table KNC1. For that, you should compose dynamically the name of the field, and then ASSIGN it to a FIELD-SYMBOL.
    Now, just add up the values!
    Please try the following code:
    FIELD-SYMBOLS: <fs>.
    DATA: t_knc1 TYPE TABLE OF knc1 WITH HEADER LINE.
    DATA: d_debits LIKE knc1-um01s.
    PARAMETERS: p_kunnr LIKE knc1-kunnr,
                p_bukrs LIKE knc1-bukrs,
                p_spmon TYPE spmon.
    DATA: l_fieldname(20) TYPE c.
    DATA: l_date LIKE sy-datum,
          l_date_from LIKE sy-datum,
          l_date_to LIKE sy-datum.
    DATA: l_period(2) TYPE n.
    DATA: l_num_times TYPE i.
    START-OF-SELECTION.
    "Compute the initial and final periods
      CONCATENATE p_spmon '01' INTO l_date.
      CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
        EXPORTING
          months  = '-1'
          olddate = l_date
        IMPORTING
          newdate = l_date_to.
      CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
        EXPORTING
          months  = '-12'
          olddate = l_date
        IMPORTING
          newdate = l_date_from.
    "Read table KNC1
      SELECT *
        INTO CORRESPONDING FIELDS OF TABLE t_knc1
        FROM knc1
        WHERE kunnr = p_kunnr
          AND bukrs = p_bukrs
          AND gjahr BETWEEN l_date_from(4) AND l_date_to(4).
    "this will yield at most 2 records, one for present year, and another one for the previous year.
    "but if you select i.e. period '01.2012', initial_date = '01.01.2011' and final_date = '31.12.2011'
    " --> thus only one year --> one record
      CLEAR: d_debits.
      LOOP AT t_knc1.
    " If there's no year change
        IF l_date_from(4) = l_date_to(4).
          DO 16 TIMES.
            l_period = sy-index.
            CONCATENATE 'UM'      "compute dynamically the field name
                        l_period
                        'S'
              INTO l_fieldname.
            ASSIGN COMPONENT l_fieldname OF STRUCTURE t_knc1 TO <fs>.   "assign
            ADD <fs> TO d_debits.                  "and add up
          ENDDO.
        ELSE.
    " If there IS a year change
          IF t_knc1-gjahr = l_date_from+0(4).
            l_num_times = 16 - l_date_from+4(2) + 1.    "you must loop 16 - initial_period + 1 times for the first year
            DO l_num_times TIMES.
              l_period = sy-index + l_date_from+4(2) - 1.
              CONCATENATE 'UM'                "compute dynamically the field name
                          l_period
                          'S'
                INTO l_fieldname.
              ASSIGN COMPONENT l_fieldname OF STRUCTURE t_knc1 TO <fs>.    "assign
              ADD <fs> TO d_debits.              "and add up
            ENDDO.
          ELSE.
            l_num_times = l_date_to+4(2).            "you must loop final_period times for the second year
            DO l_num_times TIMES.
              l_period = sy-index.
              CONCATENATE 'UM'               "compute dynamically the field name
                          l_period
                          'S'
                INTO l_fieldname.
              ASSIGN COMPONENT l_fieldname OF STRUCTURE t_knc1 TO <fs>.     "assign
              ADD <fs> TO d_debits.        "and add up
            ENDDO.
          ENDIF.
        ENDIF.
      ENDLOOP.
    You'll have the result on variable 'd_debits'.
    I hope this helps. Kind regards,
    Alvaro

  • Please help..it's Urgent..How to fetch the value from table row from Page

    Hi,
    I have created a table with 2 LOV's , LOV2 is dependent on LOV2.
    Here I can not use the general Dependent LOV concept, as these values are coming from 2 different LookUps.
    I am not able to fetch the user input for LOV1 (from page) .that is why not able to set the where cluse fro 2nd LOVVO.
    I have used this code:
    if ("ViolationCat".equals(lovInputSourceId)) {
    OAMessageLovInputBean msglov =
    (OAMessageLovInputBean)webBean.findChildRecursive("ViolationCat");
    // String p_violation_category = "'"+(String)msglov.getValue(pageContext)+"'";
    String p_violation_category =
    (String)msglov.getValue(pageContext);
    // System.out.println(" p_violation_category =" +
    // p_violation_category);
    String v_violation_category = "";
    //System.out.println("vcat=" + vCat);
    OAViewObject violationVO =
    (OAViewObject)am.findViewObject("SNI_Violation_DtlsVO2");
    Number vcatViolationIdnum =
    (Number)violationVO.getCurrentRow().getAttribute("ViolationId");
    String vcatViolationId = "" + vcatViolationIdnum;
    pageContext.putTransactionValue("vcatViolationId",
    vcatViolationId);
    pageContext.putTransactionValue("p_violation_category",
    p_violation_category);
    String query =
    " SELECT LOOKUP_CODE, \n" + " MEANING, \n" +
    " LOOKUP_TYPE \n" +
    " FROM apps.fnd_lookup_values \n" +
    " WHERE LOOKUP_TYPE ='SNI_VIOLATION_CATEGORY' AND MEANING=?";
    PreparedStatement ps = txn.createPreparedStatement(query, 1);
    try {
    ps.setString(1, p_violation_category);
    ResultSet rs = ps.executeQuery();
    //System.out.println("before while,");
    // rs.next();
    // v_violation_category = rs.getString("LOOKUP_CODE");
    // System.out.println("v_violation_category="+v_violation_category);
    while (rs.next()) {
    //System.out.println("inside while");
    v_violation_category = rs.getString("LOOKUP_CODE");
    // System.out.println("v_violation_category=" +
    // v_violation_category);
    ps.close();
    } //try ends
    catch (Exception e) {
    e.getMessage();
    //System.out.println("in catch.." + e.getMessage());
    OAViewObject subCatVO =
    (OAViewObject)am.findViewObject("SNI_ViolationSubCategoryVO1");
    //System.out.println("get VO before where clause: subCatVO::"+subCatVO.getQuery());
    subCatVO.setWhereClause("LOOKUP_TYPE like '%SNI_VIOL_SUB_CAT_" +
    v_violation_category + "'");
    System.out.println("after set where clause VO: subCat VO::" +
    subCatVO.getQuery());
    subCatVO.executeQuery();
    // System.out.println("query of subCat VO::" +
    // subCatVO.getQuery());
    //End of sub category Validation
    It is working fine only for the 1st row of teh table.
    I have tried to fetch the value using :
    String violationCategory = (String)violationVO.getCurrentRow().getAttribute("ViolationCategory");
    String violationSubcategory = (String)violationVO.getCurrentRow().getAttribute("ViolationSubcategory");
    But it is fetching null value.
    Please tell me how can I able to fetch the values.

    Hi
    in your scenarion,first u have to identify the particular row of table where the changes is being made ,u have to use this code .when u select the lov ,first it will give the row refernce and then u have to catch the lov event
    OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if ("<ItemPPREventName>").equals(event))
    // Get the identifier of the PPR event source row
    String rowReference =
    262
    pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Serializable[] parameters = { rowReference };
    // Pass the rowReference to a "handler" method in the application module.
    am.invokeMethod("<handleSomeEvent>", parameters);
    In your application module's "handler" method, add the following code to access the source row:
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    thanx
    Pratap

  • How to get the value of a clicked item in a shuttle control

    I have a shuttle control (P8_SHUTTLE) that lists then names from scott.emp.
    Now I want to create a dynamic action that fires when I click on one of the names on the left side of the shuttle control.
    I want the dynamic action to recognize the name of the employee that was clicked, and then set the value of a text item (P8_LAST_VALUE) to that ename. (Eventually I want to display the department of that employee in the other text item).
    Here are screen shots of my DA:
    http://www.screencast.com/t/42klMC0Hbk
    http://www.screencast.com/t/Y5lZ4RsaLUI
    Currently, when I click an item in the shuttle control, the text item P8_LAST_VALUE remains blank.
    Thanks,
    Christoph

    Hi Christoph,
    you have to change your jQuery selector in the When section of the Dynamic action to #P8_SHUTTLE_LEFT.
    The shuttle item P8_SHUTTLE is build from to select lists P8_SHUTTLE_LEFT and P8_SHUTTLE_RIGHT.
    regards,
    Erik-jan

  • How to set the value to ADOBE form input filed...in WDP ABAP...very urgent.

    Hi,
    SET_ATTRIBUTE is not working for the adobe forms in WDP-ABAP. Is there any other funtion to set the value in the input field of adobe forms in WDP-ABAP.
    Please let me know at the earliest
    Thanks,
    Kesav.

    Hello,
    set_attribute should work also in this case. The context element has to be bound to the given inputfield on the form.
    Can you please check your binding on the form?
    Kind regards,
    Dezso

  • How to return the values of LOV to items in forms

    Hi,
    I have created an LOV based on a select statment that return 3 columns
    I want to return theses 3 values to 3 items in the form?
    I'll appreciate any suggestion.
    Imad.

    An LOV has only two components: text and value. You can see them in the html page's source. A work around is to use a procedure to query the data and create a cursor, count the # of records in the query. Create a javascript function to create parallel arrays to hold the data on the html page and pass the function parameters via an event on the page. Create the procedure in the db.
    procedure follows...
    CURSOR c_customer
    /* use a cursor to get all the prices */
    IS
    SELECT
    c.customer_number, c.customer_name, NVL(a.address1, 'N/A') ADDRESS1,
    NVL(a.address2, 'N/A') ADDRESS2, NVL(a.city, 'N/A') CITY, NVL(a.state, 'N/A') STATE,
    NVL(a.province, 'N/A') PROVINCE, NVL(a.country, 'N/A') COUNTRY, NVL(a.postal_code, 'N/A') POSTAL_CODE
    FROM table1 b, table2 a, table3 c;
    v_count NUMBER;
    BEGIN
    SELECT COUNT(*)
    INTO v_count
    FROM table1 b, table2 a, table3 c
    where ...;
    /*where clause and table names have been removed, use your's. They should be identical in both queries */
    /* begin your Javascript, substituting values from the
    cursor as necessary into parallel arrays*/
    HTP.p('<script language="JavaScript1.1">');
    HTP.p('<!-- ');
    /* initialize the arrays */
    HTP.p(' var customer_no_arr = new Array('||v_count||'); ');
    HTP.p(' var customer_name_arr = new Array('||v_count||'); ');
    HTP.p(' var address1_arr = new Array('||v_count||'); ');
    HTP.p(' var address2_arr = new Array('||v_count||'); ');
    HTP.p(' var city_arr = new Array('||v_count||'); ');
    HTP.p(' var state_arr = new Array('||v_count||'); ');
    HTP.p(' var province_arr = new Array('||v_count||'); ');
    HTP.p(' var country_arr = new Array('||v_count||'); ');
    HTP.p(' var postal_code_arr = new Array('||v_count||'); ');
    /* populate the arrays */
    FOR r IN c_customer LOOP
    HTP.p ('customer_no_arr['||to_char(c_customer%ROWCOUNT - 1) ||'] = "'||r.customer_number||'";');
    HTP.p('customer_name_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.customer_name||'";' );
    HTP.p('address1_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.address1||'";' );
    HTP.p('address2_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.address2||'";' );
    HTP.p('city_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.city||'";' );
    HTP.p('state_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.state||'";' );
    HTP.p('province_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.province||'";' );
    HTP.p('country_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.country||'";' );
    HTP.p('postal_code_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.postal_code||'";' );
    END LOOP;
    /* use this variable to determine the size of the array */
    HTP.p ('var num_customers = '||v_count);
    /* create the function--accept a parameter that tells
    you which customer has been selected from the select_co
    combo box */
    HTP.p ('function get_customer (form, field, customer_num)
    var pieces = field.split(".");
    var address1field = new String(pieces[0] + ".MASTER_BLOCK.ADDRESS1.01");
    var address2field = new String(pieces[0] + ".MASTER_BLOCK.ADDRESS2.01");
    var cityfield = new String(pieces[0] + ".MASTER_BLOCK.CITY.01");
    var statefield = new String(pieces[0] + ".MASTER_BLOCK.STATE.01");
    var provincefield = new String(pieces[0] + ".MASTER_BLOCK.PROVINCE.01");
    var countryfield = new String(pieces[0] + ".MASTER_BLOCK.COUNTRY.01");
    var zipcodefield = new String(pieces[0] + ".MASTER_BLOCK.POSTAL_CODE.01");
    /* Get the customer number and pass it to the array to look up the address.*/
    var customer_no = customer_num;
    /* loop through the array until you find the right product ID */
    for (var i=0 ; i < num_customers; i++)
    if (customer_no_arr[i] == customer_no)
    /* return the correct customer information */
    form.elements[eval(address1field)].value = address1_arr;
    form.elements[eval(address2field)].value = address2_arr[i];
    form.elements[eval(cityfield)].value = city_arr[i];
    form.elements[eval(statefield)].value = state_arr[i];
    form.elements[eval(provincefield)].value = province_arr[i];
    form.elements[eval(countryfield)].value = country_arr[i];
    form.elements[eval(zipcodefield)].value = postal_code_arr[i];
    /* close out the Javascript */
    HTP.p ('//-->');
    HTP.p ('</SCRIPT>');
    END gen_customerlookup;
    A specific example is found in the ORACLE Press book by Steve Vandiver & Kelly Cox "ORACLE9i Application Server Portal Handbook" ISBN # 0-07-222249-2 pages 358 - 361. Several lines, and better explaination than room for here.
    get_customer (this.form, this.name, this.value); is placed in the appropriate event. Put "sales.gen_customer_lookup;" in the "before displaying the page" section. sales is the schema where the procedure gen_customer_lookup is created.
    Ken

  • HOW to set the value attribute of FORM INPUT data to a variable in a JSP

    eg. Registration.jsp
    The data is accessed from an hidden field called course
    for example, if I have "Java programming" in the field course, and I use
    an expression to access the value from the hidden field.
    **My problem is that the data gets truncated to "Java" , I need "Java Programming"to display. The code looks like this
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <INPUT TYPE="text" SIZE=12 NAME="course"
    VALUE=<%=getParameter("course") %>
    IS there ANY OTHER WAY to set the value of VALUE to a variable?

    Instead of value=<%=request.getParameter("course")%>
    Use double codes
    value="<%=request.getParameter("course")%>"

  • Setting default value of Tabular form item is not working

    Hi,
    I have a tabular form and in that I want to set the default value of the username to app_user. So in the default value of the item, I wrote v('app_user') and type Pl/SQL, but that does not seem to work. I tried the static application & page item with :app_user. That threw an error.
    Also, I wanted to populate the date field in one column. Doesn't sysdate work?
    Thanks,
    Sun

    Bob, I did read that. MY problem is that it is still not working. I am wondering if this is because the table is in execute query mode maybe? I am wondering if the default value needs to be added after the tabular data is populated through some other way? Maybe the default value would work only for static non database items?
    ThanksYou're right, I just tested that using the default setup on the column in report attributes and it did not work.
    I think you'll have to update the columns with the default value post query but I'm not sure exactly what you need to do.
    I have a form that has a weight entry column. I tried changing the query to set the default value in the query
    from..
    Select Weight
    From...
    to
    Select 999.99 Weight
    From...That appeared to work, but the 999.99 value was not populated back to the Database since it wasn't entered through the form UI. APEX maintains the entered values internally so it can do its checksumm processing and update modified rows back to the DB. I'm thinking you could update what needs to be updated using Javascript in a Dynamic Action, but I'm afraid I don't know how to do that.
    Excuse my incorrect assumption when first replying.

  • In jsp how to extract the value from a name obtained from javascript?

    It's few time i program in Java and i'm involved in an application that uses javascript to communicate between pages. I've the follow problem: in my jsp page i must process a string, but this string is produced from a javascript function. But in jsp, out of javascript function, how can i access to the value of that string of which i see from Javascript only its name?

    My string is already in a form, but i have not the request because data transmission happens through javascript: i've tried to write
    request.getParameter("StringName")
    and i've not found compilation mistakes but in execution the application gives error (maybe it doesn't find the request in the caller page)

  • How To fetch the Value of nested structure returned by RFC in c# application.

    Hello ,
    i am new to C#,i have rfc that return data from SAP system as Nested structure but when i fetching that data using
    IrfcTable table = rfc.getTable("exporting_parameter");       // et_customer
    it return's only first inner structure only .
    for example my exporting internal table for rfc is
    "et_customer" that contain sub structure as follow
              gen_data
               bank data
               tax data
    it return only value inside gen_data only.
    how to get entire data

    Hi,
    I am using Java JCO but I can see in the java doc that JCoTable have a Method
    getTable
    Check and see if you have it in .net
    Regards.

  • After hiding an item, its value cannot be used in a query. How to use the value of a hidden item.

    Hi,
    I have a shuttle. I am using its value in a query by using sql collection array. My requirement is that I need to hide that shuttle. But when I hide the shuttle, its value is not retrived by the query.
    Please give some idea how to get this functionality.
    Thanks,
    chandru

    ChandraBhanu wrote:
    Its a shuttle. so how to create an application item of shuttle type?
    pls give some idea.
    You don't create an application item of shuttle type.  Application items only hold one value, and I thought since you were using a value in a query that you were only using one.  In the case of multiple values my idea to use a page/application item will not work

  • Fetch the values from internal table inside an internal table (urgent!!)

    data : BEGIN OF PITB2_ZLINFO occurs 0,
             BEGDA LIKE SY-DATUM,
             ENDDA LIKE SY-DATUM,
             PABRJ(4) TYPE N,                       "Payroll Year
             PABRP(2) TYPE N,                       "Pay. Period
             ZL LIKE PC2BF OCCURS 0,
           END OF PITB2_ZLINFO.
    I have a internal table like this,
    How to Fetch the values from internal table inside an internal table.
    Kindly Help me on this..
    Regards,
    Ram.

    Hi,
    Try this....
    Loop at PITB2_ZLINF0.
    Loop at PITB2_ZLINF0-ZL.
    endloop.
    Endloop.
    Thanks...
    Preetham S

  • How to fetch the tabular form column value into page items

    Hi,
    I have created tabular form. I have set LOV for one column. Here my requirement is when i select the value from lov then it will fetch that value into page item.
    can any help?
    I am using apex 4.1
    Thanks
    vijay

    It's not so easy to make a dynamic action on a tabular form.
    The best thing you can do is to use the javascript API from APEX: http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/javascript_api.htm
    So if you have a tabular form then open your item and make it a column link.
    In the link location select URL.
    Your URL would be something like this
    javascript:$s('P1_PAGE_ITEM', #COLUMN_ID#);doSubmit('COLUMN_ID');The doSubmit is not required but if you don't submit your page then the server would never know about your page item.
    Off course it is possible to submit at a later point. For example you can just use the $s to set the value off an item and afterwards create a button that would submit your page.
    Be aware that if you just set the value off your page item and just link to an other page without submitting or without branching that other page would never know about your page item.
    If you want the server to know the value off a page item you need to submit it's value to the server. The easiest way is just to do the doSubmit() call after you have set your value.
    Hope this helps,
    Regards
    Nico

  • How to use Ajax Get Multiple Values in Tabular form?

    Hi All-
    I am trying to use AJAX to get multiple values in tabular form by using Denes Kubicek's example in the following link -
    http://apex.oracle.com/pls/otn/f?p=31517:239:9172467565606::NO:::
    Basically, I want to use the drop down list to populate rest of the values on the form.
    I have created the example(Ajax Get Multiple Values, application 54522) on Oracle site -
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    Workspace: iConnect
    login: demo
    password: demo
    I was able to duplicate his example on page 1 (home page).
    However, I want to use system generate tabular form to finish this example, and was not able to populate the data correctly.
    Page 2 (method 2) is the one that I am having trouble to populate the column values. When I checked application item values in Session, and the values seems to be populated correctly.
    This is what I have done on this page:
    1. Create an Application Process On Demand - Set_Multi_Items_Tabular2:
    DECLARE
      v_subject my_book_store.subject%TYPE;
      v_price my_book_store.price%TYPE;
      v_author my_book_store.author%TYPE;
      v_qty NUMBER;
      CURSOR cur_c
      IS
      SELECT subject, price, author, 1 qty
      FROM my_book_store
      WHERE book_id = :temporary_application_item2;
    BEGIN
      FOR c IN cur_c
      LOOP
      v_subject := c.subject;
      v_price := c.price;
      v_author := c.author;
      v_qty := c.qty;
      END LOOP;
      OWA_UTIL.mime_header ('text/xml', FALSE);
      HTP.p ('Cache-Control: no-cache');
      HTP.p ('Pragma: no-cache');
      OWA_UTIL.http_header_close;
      HTP.prn ('<body>');
      HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
      HTP.prn ('<item id="f04_' || :t_rownum || '">' || v_subject || '</item>');
      HTP.prn ('<item id="f05_' || :t_rownum || '">' || v_price || '</item>');
      HTP.prn ('<item id="f06_' || :t_rownum || '">' || v_author || '</item>');
      HTP.prn ('<item id="f07_' || :t_rownum || '">' || v_qty || '</item>');
      HTP.prn ('</body>');
    END;
    2. Create two application items - TEMPORARY_APPLICATION_ITEM2, T_ROWNUM2
    3. Put the following in the Page Header:
    <script language="JavaScript" type="text/javascript">
    function f_set_multi_items_tabular2(pValue, pRow){
        var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Multi_Items_Tabular2',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM2',pValue)
    get.add('T_ROWNUM2',pRow)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM2','null')
        gReturn = get.get('XML');
        if(gReturn){
            var l_Count = gReturn.getElementsByTagName("item").length;
            for(var i = 0;i<l_Count;i++){
                var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
                var l_ID = l_Opt_Xml.getAttribute('id');
                var l_El = html_GetElement(l_ID);   
                if(l_Opt_Xml.firstChild){
                    var l_Value = l_Opt_Xml.firstChild.nodeValue;
                }else{
                    var l_Value = '';
                if(l_El){
                    if(l_El.tagName == 'INPUT'){
                        l_El.value = l_Value;
                    }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
                        l_El.parentNode.innerHTML = l_Value;
                        l_El.parentNode.id = l_ID;
                    }else{
                        l_El.innerHTML = l_Value;
        get = null;
    </script>
    Add the follwing to the end of the above JavaScript:
    <script language="JavaScript" type="text/javascript">
    function setLOV(filter, list2)
    var s = filter.id;
    var item = s.substring(3,8);
    var field2 = list2 + item;
    f_set_multi_items_tabular2(filter, field2);
    4. Tabular form query:
    select
    "BOOK_ID",
    "BOOK",
    "SUBJECT",
    "PRICE",
    "AUTHOR",
    "QTY",
    "BOOK_ID" BOOK_ID_DISPLAY
    from "#OWNER#"."MY_BOOK_STORE"
    5. In Book_ID_DISPLAY column attribute:
    Add the following code to element attributes: onchange="javascript:f_set_multi_items_tabular2(this.value,'#ROWNUM#');"
    Changed to -> onchange="javascript:setLOV(this,'f03');"
    Now,  T_ROWNUM2 returns value as f03_0001. But, TEMPORARY_APPLICATION_ITEM2 returns as [object HTMLSelectElement]...
    Please help me to see how I can populate the data with this tabular form format. Thanks a lot in advanced!!!
    Ling
    Updated code in Red..

    Ling
    Lets start with looking at what the javascript code is doing.
    function f_set_multi_items_tabular(pValue, pRow){
      /*This will initiate the url for the demand process to run*/
      var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
                              'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
      if(pValue){
        /*If there is an value than submit item name with value*/
        get.add('TEMPORARY_APPLICATION_ITEM',pValue)
        get.add('T_ROWNUM',pRow)
      }else{
        /*Else set the item TEMPORARY_APPLICATION_ITEM to null*/
        get.add('TEMPORARY_APPLICATION_ITEM','null')
      /*Submit the url and te returned document is of type XML*/
      gReturn = get.get('XML');
      if(gReturn){
        /*There is something returned*/
        var l_Count = gReturn.getElementsByTagName("item").length;
        /*For all elements of the tag item*/
        for(var i = 0;i<l_Count;i++){
          /*Get the item out of the XML*/
          var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
          /*Get the id of the item*/
          var l_ID = l_Opt_Xml.getAttribute('id');
          /*Get the element in the original page with the same id as
          **the item we have in the XML produced by the ondemand process
          var l_El = html_GetElement(l_ID);
          /*Now get the value of the item form the XML*/
          if(l_Opt_Xml.firstChild){
            var l_Value = l_Opt_Xml.firstChild.nodeValue;
          }else{
            /*There is no value*/
            var l_Value = '';
          if(l_El){
            /*There is an element with the same id as the item we are processing*/
            if(l_El.tagName == 'INPUT'){
              /*The element is an input item just set the value*/
              l_El.value = l_Value;
            }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
              /*If it is a span elment and has the class grabber
              **Then set the innerHTML of the parent to the value
              **and the id of the parent to the id
              l_El.parentNode.innerHTML = l_Value;
              l_El.parentNode.id = l_ID;
            }else{
              /*Else set the value as innerHTML*/
              l_El.innerHTML = l_Value;
      get = null;
    Now where it went wrong in your initial post
    The XML that was returned by your XML process would be something like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_1">CSS Mastery</item>
      <item id="f03_1">22</item>
      <item id="f04_1">Andy Budd</item>
      <item id="f05_1">1</item>
    </body>
    When you don't use apex_item to create your tabular form a item in the table will look like
    <input id="f02_0001" type="text" value="CSS Mastery" maxlength="2000" size="16" name="f05" autocomplete="off">
    Notice the id's f02_1 and f02_0001 don't match.
    So to make it work the XML would have to look like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_0001">CSS Mastery</item>
      <item id="f03_0001">22</item>
      <item id="f04_0001">Andy Budd</item>
      <item id="f05_0001">1</item>
    </body>
    To do that simply use lpad in the ondemand process like
    HTP.prn ('<item id="f02_' || lpad(:t_rownum,4,'0') || '">' || v_subject || '</item>');
    HTP.prn ('<item id="f03_' || lpad(:t_rownum,4,'0') || '">' || v_price || '</item>');
    HTP.prn ('<item id="f04_' || lpad(:t_rownum,4,'0') || '">' || v_author || '</item>');
    HTP.prn ('<item id="f05_' || lpad(:t_rownum,4,'0') || '">' || v_qty || '</item>');
    Keep in mind that the above is based on your original post and #ROWNUM# not being lpadded with zero's.
    Nicolette

Maybe you are looking for

  • How to use HTTPS

    I am trying to use the HTTP submit button. In the submit line, I have entered a HTTPS and I have made a SSL certificate. When I use the PDF preview form in the LiveCycle 8.0 I correctly get the right message. But when I save the form and use it as a

  • How to find Unused variables in procedure,function or package

    Hi all, I want find out unused variables in procedure, function and package. I have written below script for doing this ,but i am not getting the expected result. Kindly help me to improve the below code ,so that it works as expected. {code} version

  • Strange folders into C partition created from alone

    Hi everybody Lately i found out that there were some folders created in my C disk, that i've never seen before. When i tried to delete them they did not give me permission to do so. I will give you some of the names of these folders, if that helps in

  • Attribute ADDR_SHIPT Ship to address

    Hi, I have a problem I cannot resolve that for some of my users the Ship to address number has been maintained in the attributes in PPOMA_BBP so that the user has a default delivery address. However, no matter what we do the ship to address is not de

  • Jtree expandPath is not working

    Hi All, I am performing following opertion on jtree First i am taking path of selected jtree node. i am updating jtree then i am trying to expand jtree on the basis of selected path. but it is not getting expanded at all.pls help code ---> TreePath t