How to get HttpServletRequest parameters from two forms in a JSP

I have this JSP with two forms calling the same servlet. Problem is, when I use a submit button in the second form, I am unable to retrieve the request parameters from the form through the servlet. I am wondering if anybody could give me some info on how to get the request parameters from the second form. I tried to see all the parameter names in the request by calling request.getParameterNames(). But the parameters in the second form are not even seen in the request although I am clicking the submit button in this form!

First, two forms works fine in one jsp so no need to argue about that.
Second, did you put the form actions and type ("multipart/formdata " ?) explicit in every form header ? Did you supply different form names ?
Try to call the submit function through javascript - document.forms[0].submit() for your first, and document.forms[1].submit() for your second form...
Did you forget to close the form tag by chance ?

Similar Messages

  • Problem in getting the parameters from teh form html with upload file

    I have used the jspsmartupload package:
    the html file:
    <HTML>
    <BODY BGCOLOR="white">
    <H1>jspSmartUpload : Sample 5</H1>
    <HR>
    <form METHOD="POST" ACTION="sample5.jsp"
    NAME="PW" ENCTYPE="multipart/form-data">
    <table CELLSPACING="0" CELLPADDING="3" BORDER="1" WIDTH="474">
    <!-- FILE -->
    <!-- TEXT -->
    <tr>
    <td width="150">
    <div align="left">
    <p><small><font face="Verdana">Text :  </font></small>
    </div>
    </td>
    <td width="324"><small><font face="Verdana">
    <input TYPE="TEXT" name="myText" value="">
    <br>
    </font></small></td>
    </tr>
    <!-- TEXTAREA -->
    <tr>
    <td width="150">
    <div align="left">
    <p><small><font face="Verdana">Text Area :  </font></small>
    </div>
    </td>
    <td width="324"><small><font face="Verdana">
    <textarea name="myTextArea" rows="4" value=""></textarea>
    <br>
    </font></small></td>
    </tr>
    <!-- PASSWORD -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">PassWord :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <input TYPE="PASSWORD" name="myPASSWORD" value="">
    <br>
    </font></small></td>
    </tr>
    <!-- HIDDEN -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">Hidden :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <input TYPE="hidden" name="myHidden" value="hidden">
    <br>
    </font></small></td>
    </tr>
    <tr>
    <td><small><font face="Verdana">Select a first file : 
    </font></small></td>
    <td><small><font face="Verdana">
    <input type="file" name="FILE1">
    </font></small></td>
    </tr>
    <tr>
    <td><small><font face="Verdana">Select a second file : </font></small></td>
    <td><small><font face="Verdana">
    <input type="file" name="FILE2">
    </font></small></td>
    </tr>
    <!-- CHECKBOX -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">CheckBox :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <input TYPE="CHECKBOX" name="myCheckBox" value="Value 1">
    Value 1<br>
    <input TYPE="CHECKBOX" name="myCheckBox" value="Value 2">
    Value 2<br>
    <input TYPE="CHECKBOX" name="myCheckBox" value="Value 3">
    Value 3<br>
    </font></small></td>
    </tr>
    <!-- RADIO -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">Radio :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <input TYPE="radio" name="radio" value="Value 1">
    Value 1<br>
    <input TYPE="radio" name="radio" value="Value 2">
    Value 2<br>
    <input TYPE="radio" name="radio" value="Value 3">
    Value 3<br>
    </font></small></td>
    </tr>
    <!-- SELECT -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">Simple Select :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <SELECT name="mySimpleSelect" >
    <OPTION value="Value 1">Value 1</OPTION>
    <OPTION value="Value 2">Value 2</OPTION>
    <OPTION value="Value 3">Value 3</OPTION>
    </SELECT>
    <br>
    </font></small></td>
    </tr>
    <!-- SELECT MULTIPLE -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">Multiple Select :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <SELECT multiple name="myMultSelect" >
    <OPTION value="Value 1">Value 1</OPTION>
    <OPTION value="Value 2">Value 2</OPTION>
    <OPTION value="Value 3">Value 3</OPTION>
    </SELECT>
    <br>
    </font></small></td>
    </tr>
    <!-- SUBMIT -->
    <tr>
    <td colspan="2" width="474">
    <div align="center">
    <center>
    <p><small><font face="Verdana">
    <input
    TYPE="Submit">
    </font></small>
    </center>
    </div>
    </td>
    </tr>
    </table>
    </form>
    </BODY>
    </HTML>
    the jsp file :
    <%@page language="java" import="com.jspsmart.upload.*"%>
    <%@page import="java.util.*"%>
    <jsp:useBean id="myUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
    <HTML>
    <BODY BGCOLOR="white">
    <H1>jspSmartUpload : Sample 5</H1>
    <HR>
    <%
         // Initialization
         myUpload.initialize(pageContext);
         // Upload
         myUpload.upload();          
         // Files
         out.println("<BR><STRONG>Display information about Files</STRONG><BR>");
         out.println("Number of files = " + myUpload.getFiles().getCount() + "<BR>");
         //out.println("Total size (bytes) = " + myUpload.getFiles().getSize() +"<BR>");
         for (int i=0;i<myUpload.getFiles().getCount();i++){
              out.print(myUpload.getFiles().getFile(i).getFieldName());
              if (!myUpload.getFiles().getFile(i).isMissing())
                   out.print(" = " + myUpload.getFiles().getFile(i).getFileName() + " (" + myUpload.getFiles().getFile(i).getSize() + ")");
                   myUpload.getFiles().getFile(i).saveAs("/upload/" + myUpload.getFiles().getFile(i).getFileName());
              else
                   out.print(" = vide");          
              out.println("<BR>");
         // Request
         out.println("<BR><BR><STRONG>Display information about Requests</STRONG><BR>");
         // Retreive Requests' names
         java.util.Enumeration e = myUpload.getRequest().getParameterNames();
         // Retreive parameters
         while (e.hasMoreElements()) {
              String key = (String)e.nextElement();
              String[] values = myUpload.getRequest().getParameterValues(key);               
              // Browse the current parameter values
              for(int i = 0; i < values.length; i++) {
              out.print(key + " = ");
              out.print(values[i] + "<BR>");
    %>
    </BODY>
    </HTML>
    The result shown is:
    jspSmartUpload : Sample 5
    Display information about Files
    Number of files = 2
    FILE1 = path.txt (240)
    FILE2 = WS_FTP.LOG (146)
    Display information about Requests
    radio = Value 2
    mySimpleSelect = Value 1
    myTextArea = test
    myPASSWORD =
    myMultSelect = Value 3
    myHidden = hidden
    myText = test
    myCheckBox = Value 1
    myCheckBox = Value 2
    myCheckBox = Value 3
    I would like to know if i want to get back the parameters from the form ,
    is that i must use Enumeration.
    Because i have tried request.getParameter() to get the value of radio button, textbox, checkbox and select menu, but it get the null values.
    Also, the function of Enumeration does not get the values of parameter in sequence as html form. e.g.In the html file, the first parameters should be textbox,but it displays the radio button's values first.
    How to solve the problem .
    Thanks

    This sounds like a bug in the smart upload code. I have used this stuff before, but it's probably an older version, so maybe they broke something. Enumerations aren't usually guaranteed to keep things in any particular order. I would say for now, make a method to take the enumeration and a param name to find the value. And write to the JSPSmart people.

  • How to get a values from one form to another form

    Hi All,
    I am using oracle forms 10g.
    I have created two forms. First form named as Hotel reservation req and second form named as Hotel Res Summary.
    I the first form i have one field named Requisition_number and I have one button and when i press the button in the first form the summary form is called and it need to bring all the data regarding that requisition_number in first form.
    I have written a query in when button pressed Like this
    declare
    :Global.V_REQ_NO := :XXMBHOTRESREQ_DB.REQUISITION_NO
    type r_cursor is ref cursor;
    c_XXMBHIS r_cursor;
    V_xxmbht XXMB_DOMHTRS_REQ%rowtype;
    begin
    open c_xxmbhis for select * from XXMB_DOMHTRS_REQ where requisition_number=:Global.V_REQ_NO
    loop
    fetch c_xxmbhis into v_xxmbht;
    exit when c_xxmbhis%notfound;
    --dbms_output.put_line (V_XXMBHT.REQUISITION_NUMBER);
    end loop;
    close c_XXMBHIS;
    end;
    And how to refer this to the calling form.
    But now the form is opening and record is not querying can any one correct me where i went wrong.
    Thanks & Regards
    Srikkanth
    Edited by: Srikkanth.M on Aug 19, 2011 6:43 PM

    I the first form i have one field named Requisition_number and I have one button and when i press the button in the first form the summary form is called and it need to bring all the data regarding that requisition_number in first form.If more than 1/4 of your Forms will need the REQUISITION_NUMBER then using a GLOBAL variable makes scense. However, if it is only your Hotel Reservation and Hotel Res Summary forms that will use the REQUISITION_NUMBER then use a Parameter List instead. Global variables are always of type CHAR so you could encounter conversion errors if you don't explicitly cast the value to the correct data type. Parameter object can be of type CHAR, NUMBER and DATE and offer greater flexibility. If you need an example of how to use a parameter list, open the Forms Help system, go to the Search tab and search on "Creating a Parameter List." This article give a brief overview and a list of all the built-ins associated with Parameter Lists. You will need to create a Parameter object in your Hotel Req Summary form to catch the parameter passed via the Parameter List. Then you will need to write code to do something with the value passed (usually in the When-New-Form-Instance trigger).
    Craig...

  • How to get common datas from two int.tables

    hi,
    please tell me , how to i will get the common datas between two int. tables
    & place them in third int. table.
    give me syntax.
    regards
    subhasis.

    Hi Subhasis,
    <b>SORT :</b></u>
    SORT itab.
    Extras:
    1. ... BY f1 f2 ... fn
    2. ... ASCENDING
    3. ... DESCENDING
    4. ... AS TEXT
    5. ... STABLE
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Field symbols not allowed as sort criterion.
    Effect
    The entries in the internal table are sorted in ascending order using the key from the table definition (DATA, TYPES).
    Addition 1
    ... BY f1 f2 ... fn
    Effect
    Uses the sort key defined by the sub-fields f1, f2, ..., fn of the table itab instead of the table key. The fields can be of any type; even number fields and tables are allowed.
    You can also specify the sort fields dynamically in the form (name). If name is blank at runtime, the sort field is ignored. If itab is a table with a header line, you can also use a field symbol pointing to the header line of itab as a dynamic sort criterion. A field symbol that is not assigned is ignored. If a field symbol is assigned, but does not point to the header line of the internal table, a runtime error occurs.
    If the line type of the internal table contains object reference variables as components, or the entire line type is a reference variable, you can use the attributes of the object to which a reference is pointing in a line as sort criteria (see Attributes of Objects as the Key of an Internal Table.
    You can address the entire line of an internal table as the key using the pseudocomponent TABLE_LINE. This is particularly relevant for tables with a non-structured line type when you want to address the whole line as the key of the table (see also Pseudocomponent TABLE_LINE With Internal Tables).
    If you use one of the additions 2 to 5 before BY, it applies to all fields of the sort key by default. You can also specify these additions after each individual sort field f1, f2, ..., fn. For each key field, this defines an individual sort rule which overrides the default.
    Addition 2
    ... ASCENDING
    Effect
    Sorts in ascending order. This is also the default if no sort order is specified directly after SORT. For this reason, it is not necessary to specify ASCENDING explicitly as the default sort order.
    With the addition BY, you can also specify ASCENDING directly after a sort field to define ascending order explicitly as the sort sequence for this field.
    Addition 3
    ... DESCENDING
    Effect
    Sorts in descending order. If the addition comes right after SORT, DESCENDING is taken as the default for all fields of the sort key.
    With the addition BY, you can also specify DESCENDING directly after a sort field.
    Addition 4
    ... AS TEXT
    Effect
    Text fields are sorted appropriate to the locale. This means that the relative order of characters is defined according to the text environment being used.
    When an internal mode is opened (in other words, when a roll area is opened), the text environment is automatically set to the logon language specified in the user master record. If necessary, however, you can change the text environment explicitly in your program by using a SET-LOCALE statement.
    If the addition comes directly after itab, locale-specific rules are used for all fields of the sort key where the type of these fields is C or W. After the sort, the sequence of entries usually does not match the sequence which results otherwise, without using the addition AS TEXT, i.e. with binary sorting.
    With the addition BY, you can also specify AS TEXT directly after a sort field, provided it is of type C or W, or a structured type. Otherwise, a runtime error occurs. In sort fields with a structured type, AS TEXT only affects subcomponents with type C or W.
    In case of an invalid character, a SYSLOG message is written, and the respective record is inserted at the end.
    Note
    Please keep the rules for site-specific sorting in mind.
    Example
    Sort a name table with different keys:
    TYPES: BEGIN OF PERSON_TYPE,
             NAME(10)   TYPE C,
             AGE        TYPE I,
             COUNTRY(3) TYPE C,
           END OF PERSON_TYPE.
    DATA: PERSON TYPE STANDARD TABLE OF PERSON_TYPE WITH
                      NON-UNIQUE DEFAULT KEY INITIAL SIZE 5,
          WA_PERSON TYPE PERSON_TYPE.
    WA_PERSON-NAME    = 'Muller'. WA_PERSON-AGE = 22.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Moller'. WA_PERSON-AGE = 25.
    WA_PERSON-COUNTRY = 'FRG'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Möller'. WA_PERSON-AGE = 22.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Miller'. WA_PERSON-AGE = 23.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    SORT PERSON.
    Now, the sequence of the table entries is as follows:
    Miller  23  USA
    Moller  25  FRG
    Muller  22  USA
    Möller  22  USA
    If, for example, you apply German sort rules where the umlaut comes directly after the letter 'o' in the sort, the data record beginning with 'Möller' would not be in the right place in this sequence. It should come second.
    Provided a German-language locale is set (e.g. sorting is according to German grammatical rules, see also SET LOCALE), you can sort the names according to German rules as follows:
    SORT PERSON BY NAME AS TEXT.
    Now, the sequence of table entries is as follows:
    Miller  23  USA
    Moller  25  FRG
    Möller  22  USA
    Muller  22  USA
    Further examples:
    SORT PERSON DESCENDING BY COUNTRY AGE NAME.
    Now, the sequence of table entries is as follows:
    Miller  23  USA
    Möller  22  USA
    Muller  22  USA
    Moller  25  FRG
    SORT PERSON DESCENDING BY AGE ASCENDING NAME AS TEXT.
    Now, the sequence of table entries is as follows:
    Muller  22  USA
    Möller  22  USA
    Miller  23  USA
    Moller  25  FRG
    Addition 5
    ... STABLE
    Effect
    Uses a stable sort, that is, the relative sequence of entries that have the same sort key remains unchanged.
    Unlike additions 2 to 4, you cannot use this addition directly after a sort field.
    Notes
    General:
    The number of sort fields is restricted to 250.
    The sort process is only stable if you use the STABLE addition. Otherwise, a predefined sequence of fields used to sort a list is not usually retained.
    It does not make sense to use the SORT command for a SORTED TABLE. If the table type is statically declared, the system returns a syntax error if you try to SORT the table. If the table type is not statically declared (for example, because the table was passed to a FORM routine as an INDEX TABLE in a parameter), and the system can interpret the SORT statement as an empty operation, it ignores the statement. This is the case when the key in the BY clause corresponds to the beginning of the table key. Otherwise, a runtime error occurs.
    To delete all duplicate entries from a sorted internal table (e.g. just after SORT), you can use the DELETE ADJACENT DUPLICATES FROM itab statement.
    When using the addition AS TEXT, the sequence of entries after the sort does not usually match the sequence resulting from a binary sort, i.e. if the addition AS TEXT is not specified. The consequence of this is that after the SORT, you are not allowed to access with the READ TABLE itab ... BINARY SEARCH statement.
    If you still want to access data sorted apppropriate to the locale with a binary search, you can do this by including an additional component in the table where you can explictly store the data formatted using the CONVERT TEXT ... INTO SORTABLE CODE statement. This is also recommended for performance reasons if you have to re-sort the table several times according to locale-specific criteria.
    If the internal table has more than 2^19 lines or is larger than 12 MB, the system sorts it physically using an external auxiliary file. You can specify the directory in which the file should be created using the SAP profile parameter DIR_SORTTMP. By default, the system uses the SAP data directory (SAP profile parameter DIR_DATA).
    Notes
    Performance:
    The runtime required to sort an internal table increases with the number of entries and the length of the sort key.
    Sorting an internal table with 100 entries with a 50 byte key requires about 1300 msn (standardized microseconds). Using a 30-byte key, the runtime is about 950 msn.
    If one of the specified sort criteria is itself an internal table, SORT may sometimes take much longer.
    The runtime increases if you use a stable sort.
    Physical sorting reduces the runtime required for subsequent sequential processing.
    Reward If Useful.
    Regards,
    Chitra

  • Transaction Launcher : How to get return parameters from an external URL

    Hello,
    We need to launch an external URL in the Web Client UI. After the URL is launched, the user does some processing which results in some output values. These value have to be passed back to the Web Client UI and become a part of the quotation he is creating.
    We are able to launch the URL using the Transaction Launcher. But we are not able to find a way to get the output values from the external URL to the Web client UI.
    Please suggest any approach for this. It is OK even if we need to use an intermediate BSP to launch the external URL.
    Regards
    Ajay

    hi ajay
    I had a similar requirement , when the user clicks on button I want to launch the  External URL , can you please let me know how to launch the external url when the user cliks on button
    Thanks & Regards
    madhu

  • How to get a rowcount from two different schema in two different databases?

    Hello,
    I want to count of rows in each table in a schema say test, of DEV1 database to another schema say test of DEV2 database. both have same schema data in both the databases. my output should look something like this.
    Tablename
    database name DEV!, schema name test , tablename: count
    database name DEV2, schema name test , tablename: count
    can someone help me please.
    Thanks a lot

    Give this a try in dba1 - assuming there is a db link in dba1 to dba2:
    select 'DBA1', count(*) from table
    union all
    select 'DBA2', count(*) from table@dba2
    Note that if these are large tables, you may want to gather stats on the two tables (IMPORTANT) and then do
    select 'DBA1', num_rows from all_tables where table_name = 'TABLE'
    union all
    select 'DBA2', num_rows from all_tables@dba2 where table_name = 'TABLE'
    If you don't gather stats - the num_rows column in all_tables will reflect the number of rows that were present when stats were last gathered and will not reflect any inserts/deletes that have taken place since.
    The "union all" clause differs from "union" in that "union all" shows every matching result from both halves of the union - whereas union will only show each unique result once.
    Hope this helps!

  • Is there a link that demonstrates how to get the information from the forms into a database?

    I have set up a form for a client's web site and I don't want the client to have to deal with a vast quantity of emails each with the form entries. I want the information to go directly into my client's database and I didn't want to use Business Catalyst. Let me know which database program would be the best for them to use. Preferably Mac.

    Hi David,
    There is a similar thread live with us , you can follow the Database of Form Entries
    Hope that works
    Thanks
    Prabhakar Kumar

  • How to pass Parameters between two forms

    im trying to do this but i could not find any way for this.
    can any one help me how can i pass parameters between two forms
    in forms4.5. any help will be appreciated
    thanks.
    null

    Global variables can be used, but you can do what the online help
    says ...
    Parameters are passed to called forms by means of a parameter
    list. A parameter list is a named programmatic construct that is
    simply a list of parameter names (called keys) and their values.
    You can pass parameter values to forms invoked by the built-in
    subprograms CALL_FORM, OPEN_FORM, and NEW_FORM. In addition, you
    can pass parameter values to other Oracle tools with the
    RUN_PRODUCT procedure.
    A parameter you include in a parameter list can be either a text
    parameter or a data parameter. The parameter type determines how
    its value is interpreted.
    Text Parameters The value of a text parameter being passed to a
    called product is a CHAR string that can represent the following:
    n a user-defined form parameter defined in a form invoked
    by the CALL_FORM, OPEN_FORM, or NEW_FORM built-in subprograms
    n a command line or user-defined parameter for a product
    invoked with the RUN_PRODUCT built-in subprogram
    Data Parameters The value of a data parameter being passed to a
    called product is always the name of a record group defined in
    the current form. (A record group is a data structure that
    stores records derived from a query or through programmatic
    assignment.) Data parameters are used to pass data to products
    invoked with the RUN_PRODUCT built-in subprogram. You cannot
    pass data parameters to forms.
    The following table shows the structure of a parameter list that
    contains four parameters:
    Key Paramtype Value
    CITY Text_Parameter 'BOGOTA'
    CATEGORY Text_Parameter 'EXPORTS'
    MULTIPLIER Text_Parameter '.0275'
    NEW_DATA Data_Parameter 'RECORD_GROUP8'
    arun reddy (guest) wrote:
    : im trying to do this but i could not find any way for this.
    : can any one help me how can i pass parameters between two forms
    : in forms4.5. any help will be appreciated
    : thanks.
    null

  • How do I get the values from a form?

    How do I get the values from a form?

    You can try using request method..
    request.getParameter("yourFormInputName");
    Try this.

  • How to open a page from a Form and pass parameters to the form on that page

    I found a similar example on this forum, but it did not work for me:
    declare
    l_names owa.vc_arr;
    l_values owa.vc_arr;
    i number;
    begin
    PORTAL.wwpro_api_parameters.retrieve(l_names, l_values);
    FOR i in 1..l_names.count
    LOOP
    htp.p(l_names(i) || ' ' || l_values(i));
    END LOOP;
    end;
    By using this method i get the parameters for the Form, like the session ID, but not the parameters for the Page that the form is displayed in.
    Another method I tried:
    To open a Form from a Form and pass parameters works fine like this:
    --In the After processing page PL/SQL event.
    declare
    v_id number;
    blk varchar2(10):='DEFAULT';
    Begin
    v_id:=p_session.get_value_as_number (p_block_name=&gt;blk,p_attribute_name=&gt;'A_ID');
    if v_id &gt; 0 then
    htp.formOpen('PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=2649500412&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=ID&p_arg_values='||to_char(v_id),'post');
    htp.formSubmit(NULL,'Upload Files');
    htp.formClose;
    end if;
    End;
    But I want to open a Page containing the Form instead of just opening the Form. Is this possible to open a Page and pass paramters to the page, and then let the form inside the Page access the passed paramters. The reason for this is that a Form cannot be based on a page template, or can it? When opening the form i want to keep the left menu, which I can if it is a page based on my template with the left menu.
    Best regards
    Halvor

    Hi,
    You can do this by calling the url of the page with the form. You can then use p_arg_names and p_arg_values to pass parameters. In the called form you can get the value from p_arg_names and p_arg_values and assign it to the form field.
    You can call this code in the success procedure of the calling form.
    declare
    v_id number;
    blk varchar2(10):='DEFAULT';
    v_url varchar2(2000);
    Begin
    v_id:=p_session.get_value_as_number (p_block_name=>blk,p_attribute_name=>'A_ID');
    v_url := <page_url>;
    if v_id > 0 then
    call(v_url||'&p_arg_names=id&p_arg_values='||v_id);
    end if;
    End;
    In the called form in "Before displaying form" plsql section write this code.
    for i in 1..p_arg_names.count loop
    if p_arg_names(i) = 'id' then
    p_session.set_value(
    p_block_name => blk,
    p_attribute_name => 'A_ID',
    p_value => p_arg_values(i)
    end if;
    end loop;
    This code picks up the value from p_arg_values and assigns it to the form field.
    Hope that helps.
    Thanks,
    Sharmila

  • Pass Checkbox Parameters from HTML Form to a stored procedure

    I'm still looking for a solution to my forms problem. FYI, I'm not using Applications Express to build my application--I'm using straight PL/SQL. I need to know how to pass checkbox parameters from my Web form. I'm allowing folks to select one or more checkboxes on a form that will call a delete function to delete the selected records. What I read in Oracle's "Database Application Developer's Guide - Fundamentals" isn't helpful to me. If someone would point me to some examples, maybe I could see what I'm doing wrong. Here's what was written in "Database Application Developer's Guide - Fundamentals":
    All the checkboxes with the same NAME attribute make up a checkbox group. If none of the checkboxes in a group is checked, the stored procedure receives a null value for the corresponding parameter.
    If one checkbox in a group is checked, the stored procedure receives a single VARCHAR2 parameter.
    If more than one checkbox in a group is checked, the stored procedure receives a parameter with the PL/SQL type TABLE OF VARCHAR2. You must declare a type like this, or use a predefined one like OWA_UTIL.IDENT_ARR. To retrieve the values, use a loop:
    CREATE OR REPLACE PROCEDURE handle_checkboxes ( checkboxes owa_util.ident_arr )
    AS
    BEGIN
    FOR i IN 1..checkboxes.count
    LOOP
    htp.print('&lt;p&gt;Checkbox value: ' || checkboxes(i));
    END LOOP;
    END;
    SHOW ERRORS;

    I'm not sure I understand what your issue is.
    If your web form has the following checkboxes defined all with the same name:
    <input type="checkbox" name="attrib" value="1">one</input>
    <input type="checkbox" name="attrib" value="2">two</input>
    <input type="checkbox" name="attrib" value="3">three</input>Then you would create and register a procedure to handle the form submission that has a parameter with the name attrib of type owa_util.ident_arr e.g.:
    create or replace procedure handle_form(attrib owa_util.ident_arr) as
      iter number;
    begin
      for iter in attrib.first .. attrib.last loop
        -- do something with attrib(iter)
      end loop;
    end;
    /Now the one problem with this handler (or any form handler for that matter) is that if the user selects none of the check boxes, or no value for any of the expected parameters, the handler would be called with some parameters missing or with out any parameters passed to it, and the call will error out.
    To get around that you need to provide default values for all the parameters passed to your handler including the ident_arr parameters, however with ident_arr parameters that's difficult to do with standalone procedures. If you place your procedure in a package you can define package level variables of the appropriate types that can be used as default values:
    create or replace package my_web as
      empty_arr owa_util.ident_arr;
      procedure handle_form(attrib owa_util.ident_arr := empty_arr);
    end my_web;
    create or replace package body my_web as
      procedure handle_form(attrib owa_util.ident_arr := empty_arr) as
        iter number;
      begin
        for iter in attrib.first .. attrib.last loop
          -- do something with attrib(iter)
        end loop;
      end;
    end my_web;
    /now when you hit the situation where the user doesn't select any check boxes, the call to handle_form won't err out due to missing parameters, and the empty_arr won't have any elements to iterate over so the loop in the procedure body will be fine and you will be able to retrieve each selected check box value from the attrib array when you iterate over it.

  • How to get real value from selectOneChoice with javascript?

    Hi,
    How to get real value from selectOneChoice with javascript? The event.getNewValue() only gets me the index of the selected item, not the value/title.
    JSF page:
    <af:resource type="javascript">
    function parseAddress(event)
    alert("new value: " + event.getNewValue());
    </af:resource>
    <af:selectOneChoice label="Location:" value="" id="soc4">
    <af:clientListener type="valueChange" method="parseAddress" />
    <f:selectItems value="#{Person.locations}" id="si7"/>
    </af:selectOneChoice>
    HTML :
    <option title="225 Broadway, New York, NY-10007" selected="" value="0">225 Broadway (Central Office)</option>
    <option title="90 Mark St., New York, NY-10007" value="1">90 Mark St. (Central Office)</option>
    Thanks a lot.

    Something I was missing ,
    You need to add valuePassThru="true" in your <af:selectOneChoice component. I have personally tested it and got the actual value in alert box. I hope this time you got the real solution. You can also test the following code by your end.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelBox text="PanelBox1" id="pb1">
    <af:selectOneChoice label="Set Log Level" id="soc1"
    value="#{SelectManagedBean.loggerDefault}"
    valuePassThru="true">
    <af:selectItem label="select one" value="First" id="s6"/>
    <af:selectItem label="select two" value="Second" id="s56"/>
    <af:clientListener method="setLogLevel" type="valueChange"/>
    </af:selectOneChoice>
    <af:resource type="javascript">
    function setLogLevel(evt) {
    var selectOneChoice = evt.getSource();
    var logLevel = selectOneChoice.getSubmittedValue();
    // var logLevelObject = AdfLogger.NONE;
    alert("new value is : " + logLevel);
    //alert(evt.getSelection);
    //alert(logLevelObject);
    evt.cancel();
    </af:resource>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

  • How to get a parameter from BPC and use it in ABAP program

    Hello gurus!
    I got a problem...
    SAP BPC will send parameters such as year, division, category, company code and so on via script logic to SAP BW.
    I need to get these parameters from BPC and use them in a ABAP program as a filter.
    This ABAP program will do several routines and return new values to BPC. It must be made on ABAP and I need to filter data to avoid performance issues.
    Does anybody knows how to do it? or have a example of it?
    Thank you in advance.
    Regards,
    Rubens Kumori

    Hello, I'm looking for a suggest.
    I need to pass two parameters (users can input them in a data manager package in bpc) to a BAdI.
    In this BAdI I write a code that store those parameters in a InfoObject.
    The problem is:
    - one parameter is for CATEGORY value. CATEGORY is a dimension of the application and I read the value with a code like this:
          READ TABLE it_cv INTO l_s_it_cv
               WITH TABLE KEY dim_upper_case = 'C_CATEGORY'.
    - other parameter is a generic DATE. this parameter is not a dimension of the application and I don't know how I can retrieve this value in BAdI.
          READ TABLE it_cv INTO l_s_it_cv
               WITH TABLE KEY dim_upper_case = '.....'.
    The data manager dynamic script is:
    PROMPT(SELECTINPUT,,,,"%CATEGORY_DIM%")
    PROMPT(TEXT,%SELECTED_DAY%,"Write the date (format YYYYMMDD)",)
    I also have a dynamic constant that assign the name %CATEGORY_DIM% to "C_CATEGORY" value.
    Can anyone help me?
    thanks a lot
    Edited by: Luca Novali on Feb 13, 2012 3:49 PM

  • How to get column value from DB grid

    Hi!
    I wander how to get col value from GridControl?
    My app consists of one rowsetinfo with two
    columns CODE and DESCRIPTION and a jbutton
    titled SELECT. When user clicks SELECT button
    the app should show the value of the CODE col
    of the selected row in GridControl.
    I wander how to make this action ?
    XxpsTransTimesMasterIter.setAttributeInfo( new AttributeInfo[] {
    CODEXxpsTransTimesMasterIter,
    DESCRIPTIONXxpsTransTimesMasterIter} );
    XxpsTransTimesMasterIter.setName("XxpsTransTimes");
    XxpsTransTimesMasterIter.setQueryInfo(new QueryInfo(
    "XxpsTransTimesMasterIterViewUsage",
    "lov.XxpsTransTimes",
    "CODE, DESCRIPTION",
    "XXPS_TRANS_TIMES",
    null,
    null
    ));

    Hi,
    You could attach an ActionListener on the JButton, and try the following code :
    NavigationManager fm = NavigationManager.getNavigationManager();
    DataItem dataItem = fm.getFocusedControl().getDataItem();
    ImmediateAccess col_code = null;
    String code = null;
    if (dataItem != null && dataItem instanceof RowsetAccess) {
    RowsetAccess rowset = (RowsetAccess)dataItem;
    try {
    col_code = (ImmediateAccess) rowset.getColumnItem("CODE");
    code = col_code.getValueAsString();
    } catch (DuplicateColumnException de) {
    return;
    } catch (ColumnNotFoundException ce) {
    return;
    } catch (SQLException se) {
    return;
    JTextField tf = new JtextField();
    tf.setText(code);
    I haven't tested this code.
    I am curious to know, the Object type of the dataItem.If it doesnot happen to be RowsetAccess ..try.. ScrollableRowsetAccess OR ImmediateAccess.
    Your code would change accordingly, depending on the instance.Refer to the product documentation for this.
    Do let me know, if this works.
    TIA
    Sandeep

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

Maybe you are looking for

  • Apple loads every time I restart the computer like it is installing an update-

    after updating the OS to yosemite. I had the common Java Runtime Environment Problem "To view this web content, you need to install the Java Runtime Environment.  Click "More info..."to visit the the website for the Java Runtime Environment"  pop up

  • Cost analysis through Purchase Order created from Sales Order

    Hi Experts, This is the scenario: There is an Item No. which is not stocked in warehouse and is purchased only when customers ask for it. The cost of the sales order line having this item is calculated by the Purchase Order line on which the item is

  • Re-2013 27'' iMac USB 3.0 troubles-.

      Hi guys   the 19th of October i got my brand new 27'' iMac  i5 3,2GHZ, 24GB Ram, G-Force GT 755M, 1TB..   got it home, powered it, updated it's software but NO Mavericks yet - being a work machine, i always wait a while to update OS until i'm sure.

  • Dchroot - where can i find it?

    hello! i installed a 32bit chroot in /opt/arch32 as written on http://wiki.archlinux.org/index.php/Arc - bit_system. now i need dchroot, but that is not avaible via pacman: bash-3.2# pacman -Ss schroot bash-3.2# pacman -Ss chroot extra/fakechroot 2.6

  • Purpose of Events

    Hi friends,                    What is the use of events in abap programing thanks and regards, Binoy R Moderator message: please search for available information/documentation before asking, do not ask interview-type questions. Edited by: Thomas Zlo