Multiple selection Forms in JSP

I have a JSP page that should insert as many as selected choices on
          the forms into a sql server database.
          This example is done in ASP:
          http://www.codeave.com/ASP/multiple_where.asp
          

"Sam" <[email protected]> wrote in message
          news:[email protected]..
          > There is 1 JSP page which needs to process as many as selected rows on
          > the form <OPTION> MULTIPLE.
          Sam,
          Is there a question in your last two posts or are you just sharing
          statements of fact with us ;)
          

Similar Messages

  • Process multiple select form element in JSTL

    I am trying to retrieve the values from a multiple select dropdown. From searching the forums, I now know that I need to use getParameterValues instead of getParameter in JSP. However, how would like to do this in JSTL with the core tags? Here is the code I now have (but it only prints the first element selected from the multiple select.
        <c:forEach var="map_entry" items="${param}">
          <strong><c:out value="${map_entry.key}"/></strong>
          <c:out value="${map_entry.value}"/><br />
          <c:forEach var='stuff' items='${map_entry.value}'>
            <c:out value='${stuff}'/><br /><br />
          </c:forEach>
        </c:forEach>Notice the second foreach loop doesn't work (it only prints the first value). Any ideas? Thanks!

    use something like this:
    <c:forEach var="elem" items="${paramValues.multipleSelect}">
    <c:out value="${elem}"></c:out>
    </c:forEach>
    the key is "paramValues" instead of "param"
    regards, Alex

  • Best way to create a multiple select form?

    I have been trying to create a form that will allow selection parameters to be entered to populate a list that the user can then select one or more of the values in the list for use in another form.
    The following is the code I have come up with so far:
    DECLARE
    lc_query VARCHAR2(32767);
    lc_where VARCHAR(4000);
    BEGIN
    lc_query := 'SELECT HTMLDB_ITEM.CHECKBOX(1,ROWNUM) AS prd_check, '||
    ' HTMLDB_ITEM.HIDDEN(2,a.asset_id) AS asset_id, '||
    ' sup.name||'' ''||prd.description|| '||'' Asset Tag:''||a.asset_tag '||'' Serial Number:''||a.serial_number AS asset_name '||
    'FROM supplier sup, '||
    ' product prd, '||
    ' asset a '||
    'WHERE a.prd_id = prd.prd_id '||
    'AND prd.sup_id = sup.sup_id '||
    'AND a.hardware_software = ''HDW'' '||
    'AND a.responsibility_indicator IN (''1'',''2'',''4'',''9'') ';
    IF :P4_AT_ID <> -1 THEN
    lc_where := lc_where ||' AND a.at_id = :P4_AT_ID';
    END IF;
    IF :P4_SUP_ID <> -1 THEN
    lc_where := lc_where ||' AND prd.sup_id = :P4_SUP_ID';
    END IF;
    IF :P4_PRD_ID <> -1 THEN
    lc_where := lc_where ||' AND a.prd_id = :P4_PRD_ID';
    END IF;
    IF :P4_SELECTION IS NOT NULL THEN
    lc_where := lc_where
    ||' AND ( UPPER(a.asset_tag) LIKE ''%''||UPPER(:P4_SELECTION)||''%''
    OR UPPER(a.serial_number) LIKE ''%''||UPPER(:P4_SELECTION)||''%''
    OR UPPER(a.reference_number) LIKE ''%''||UPPER(:P4_SELECTION)||''%''
    OR UPPER(prd.description) LIKE ''%''||UPPER(:P4_SELECTION)||''%'' ) ';
    END IF;
    lc_query := lc_query ||lc_where;
    RETURN lc_query;
    END;
    I then call the following process that calls a package to insert the rows into my base table of the calling form:
    DECLARE
    l_asset_id NUMBER;
    BEGIN
    IF HTMLDB_APPLICATION.G_F01.COUNT > 0 THEN
    FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
    l_asset_id := TO_NUMBER(HTMLDB_APPLICATION.G_F02(HTMLDB_APPLICATION.G_F01(i)));
    survey_pkg.p_ins_ua ( p_prsn_id => TO_NUMBER(:P4_PRSN_ID),
    p_asset_id => l_asset_id,
    p_eftv_from => TRUNC(SYSDATE));
    END LOOP;
    END IF;
    END;
    However, if the search query does not narrow down enough rows (about 50 rows) I get an ORA-01403 error on selection of the rows.
    Question:
    Is this the correct approach?
    If YES then does anyone know where I have gone wrong?
    If NO then what is a better approach?
    Thanks in anticipation,
    Jon

    In the end I abandonded the use of using HTMLDB_ITEM and HTMLDB_APPLICATION packages and went back to more standard functionality.
    Rather than developing a report using the function above I instead created a multi-select list ITEM and created a List of Values for this based on the function above. This then changes the values in the list on change of my selection criteria. The underlying item then provides my input into my package to create values in the other form, much tidier solution!

  • Multiple select multipart/form-data + FileUploader

    Hi
    I'm using asp multiple select form field with
    multipart/form-data +
    FileUploader to upload a file (works fine) and writing the
    contents of
    a form to a database which works fine apart from the multiple
    select
    which although allows me to select multiple items only
    returns the
    first selected item to the database.
    Anywork arounds to this??
    Thanks in advance!!
    Buzby
    There's nothing more dangerous than a resourceful idiot

    Multi-part requests are not packaged the same as regular requests, so the getParameter() method doesn't work on it (although I think it would get anything passed through the query string as part of the action parameter but I'm not sure).
    You can also try the com.oreilly.servlet class MultipartRequest. I don't know if that's the same one found in the www.servlets.com link, but it is REALLY easy. Essentially, it looks like this:
    MultipartRequest mr = new MultipartRequest(request, "[pathtosavefiles]'");
    String param = mr.getParameter("paramname");
    So instead of calling getParameter() on the request object, you now instead call it on the MultipartRequest object. When you instantiate the MultipartRequest object, it parses the request body for you, and also saves any uploaded files into the directory you specified in your path in the constructor.
    I hope that helps.
    Michael

  • JSP Select Form loses value

    When I do a database query for values for the select they display properly but when it is submitted the next page only has the variable not the value. Any ideas?
    <form action=getprinter.jsp>
    <select name="printers">
    <%
    while(rs.next())
    prnt=rs.getString("printer_id"); %>
    <option value=prnt><% out.println(prnt.toUpperCase());%>
    </select>
    <input type=text name="ponum" value=00000 maxlength=5 size=10>
    <input class="submitbutton" type="submit" value="Select">
    </form>

    <select name="printers">
    <%
    while(rs.next())
    prnt=rs.getString("printer_id"); %>
    <option value=prnt><%
    out.println(prnt.toUpperCase());%>
    <%
    some mo code....
    %>
    On the select tags, the value parameter is what is passed to the getprinter.jsp page. What you have is a drop down list with multiple options on it, different display names but all with the same value. You need to dynamically put the prnt value in the value attribute and in the option body.
    <%
      while( rs.next() )
         prnt = rs.getString("printer_id");
    %>
      <option value="<%=prnt.toUpperCase()%>"><%=prnt.toUpperCase()%></option>
    <%
    %>

  • How to get multiple selections from jsp page in my servlet

    Hello Everyone,
    I've a list that allows users to make multiple selections.
    <select name=location multiple="multiple">
        <option>
             All
        </option>
        <option>
             Hyd
        </option>
        <option>
             Dub
        </option>
        <option>
             Mtv
        </option>
      </select>I want to get the selections made by user in jsp page from my servlet, selections can be multiple too.
    ArrayList locList = new ArrayList();
    locList = request.getParameter("location");when I do so, I get compilation error as the request returns string type. How do I then get multiple selections made by the user.
    Please let me know.

    For those kind of basic questions it would help a lot if you just gently consult the javadocs and tutorials.
    HttpServletRequest API: [http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html]
    Java EE tutorial part II: [http://java.sun.com/javaee/5/docs/tutorial/doc/]
    Coreservlet tutorials: [http://courses.coreservlets.com/Course-Materials/]

  • Get all the values from a multiple select in a multipart form

    Hi there!
    I am using a form with enctype="multipart/form-data" in order to upload files from the form.
    I have read this page: http://commons.apache.org/fileupload/using.html and everything works well for my form.
    The only problem is that I can't get all the values from a "multiple select" html object. I get only one value.
    Using servlets I have used this method:
    public java.lang.String[] getParameterValues(java.lang.String name) But now I have enctype="multipart/form-data" in my form and I can't use this way...
    Is there a way to get all the values of a multi-valued parameter?
    Thanks a lot!
    Stefano

    Hi
    I have got solution for this problem so, I am listing here logic
    assume tag name of html
    <select name="moption" multiple="multiple">
    iterate it in as
    String moption="";
    boolean cnt=true;
    while(itr.hasNext())
    FileItem fi=(FileItem)itr.next();
    if(fi.isFormField())
    if(fi.getFieldName().equals("moption"))
    if(cnt==true)
    moption=fi.getString();
    cnt=false;
    else
    moption=moption+","+fi.getString();
    If wants more help then mail me your problem
    at [email protected]
    Thanks!
    Anand Shankar
    Edited by: AnandShankar on 6 Nov, 2009 12:54 PM

  • How can i select multiple values form select list

    Hi ,
    I have created few items in a page and all items are Lov items and based on these items stacked charts will display. My requirement is I need to select multiple values form LOV's
    Eg: In Interactive report goto filter and select an item and expression as IN and select multiple items and i need to select multiple values like this.
    Please anybody help me how to get multiple values.
    I have one more doubt Can we have a Print preview option in APEX.
    I have to see print preview for stacked charts. is it possible?
    Regards
    Narender B

    HI ,
    Thank you for valuable information and looks good.but Here our client need to select multiple values.... for eg: Open IR report and click on Actions button --->select filter
    select any column , operator as IN and from expression select multiple items.
    I need to select multiple values in that way so, could you please guide me how can i achieve this.
    Regards
    Narender B

  • Multiple Select boxes in one form

    Does anyone know if it is possible to have multiple select
    boxes inside one form? I have six different select boxes that are
    generated by six separate queries. The action page for all six
    select boxes is the same so I just want one submit button so users
    don't get confuse. I don't want to cluster up the page with submit
    buttons but I may resort to that option.
    My problem is the select boxes generate a number and when
    that number is submitted I want to pass two other variables with it
    to the action page. I tried putting a "Form" tag around the 6
    select boxes. Inside each select box I tried to add an "Input
    type="hidden"" and give thte name and values that I needed. That
    worked for the first select box but when I tried the second select
    box it used the hidden values for the first select box.
    If anyone can help, I would greatly appreciate it. Or if you
    have any other suggestions I am open to any.
    Thanks

    Paross1,
    I wasn't thinking about that and you gave me a great idea.
    Here is how I changed my select boxes.
    <cfform
    action="Resolution_History.cfm?year=#year#&sessiontype=#sessiontype#&btype=res"
    name="form">
    <select name="SRINPUT">
    <option value="">SR
    <CFOUTPUT Query="findSR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="HRINPUT">
    <option value="">HR
    <CFOUTPUT Query="findHR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="SCRINPUT">
    <option value="">SCR
    <CFOUTPUT Query="findSCR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <br>
    <select name="HCRINPUT">
    <option value="">HCR
    <CFOUTPUT Query="findHCR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="SJRINPUT">
    <option value="">SJR
    <CFOUTPUT Query="findSJR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <select name="HJRINPUT">
    <option value="">HJR
    <CFOUTPUT Query="findHJR"><Option
    Value="#BILLNUMBER#">#BILLNUMBER#</cfoutput>
    </select>
    <INPUT TYPE="Submit" VALUE="Submit" alt="submit
    button">
    </cfform>
    On the action page I need the below IF statement to work so
    it will set the variables. It isn't working at this time. Its not
    bringing the values of billnumber, houseorig or the billtype.
    Do you have any thoughts? I know it is close. I need to set
    all of the inputs to input4 to generate my queries.
    <cfif form.srinput gt 0>
    <cfset houseorig eq "s">
    <cfset billtype eq "r">
    <cfset srinput eq input4>
    <cfelseif form.hrinput gt 0>
    <cfset houseorig eq "h">
    <cfset billtype eq "r">
    <cfset hrinput eq input4>
    <cfelseif form.scrinput gt 0>
    <cfset houseorig eq "sc">
    <cfset billtype eq "r">
    <cfset scrinput eq input4>
    <cfelseif form.hcrinput gt 0>
    <cfset houseorig eq "hc">
    <cfset billtype eq "r">
    <cfset hcrinput eq input4>
    <cfelseif form.sjrinput gt 0>
    <cfset houseorig eq "sj">
    <cfset billtype eq "r">
    <cfset sjrinput eq input4>
    <cfelse>
    <cfset houseorig eq "hj">
    <cfset billtype eq "r">
    <cfset hjrinput eq input4>
    </cfif>

  • How to submit a multiple-selection list box in an Infopath Sharepoint form as multiple entries on a Sharepoint list?

    I would like to be able to submit an Infopath form with a multiple selection list box in Sharepoint as multiple entries on a Sharepoint list.
    For example, a user has to complete the following fields:
    First Name:
    Last Name:
    Favorite Color (can select more than one):
    [] Blue
    [] Red
    [] Yellow
    [] Green
    If the user picks blue AND red and submits the form, the Sharepoint list would feature TWO entries, both with their first and last names, but with different colors in the "Favorite Color" column.
    Please let me know if there is a way to do this. Any guidance would be helpful!

    Hi redhotc,
    According to your description, my understanding is that you want to set multiple default values for a multiple checkbox list in InfoPath form.
    I did a test with SQL database table. I set three default values for the checkbox list by adding three values field under the group field(Data->Default values), each value field is for a default value. Then publish it to my SharePoint site, everything
    was fine.Please have a try as the below link:
    http://www.bizsupportonline.net/infopath2010/pre-select-items-multiple-selection-list-box-infopath-2010.htm
    Note: if you are using SQL databse table, you may need to enable ‘Allow cross-domain data access for user form templates that use connection settings in a data connection file’ in CA. More information, please refer to:
    http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010customization.aspx?ID=418b9423-a96c-4e5e-91f9-6a1b010ebb69
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Multiple selections in an HTML form

    The option selector (<select>...</select>) in an HTML form allows the
    user to make multiple selections. However, when the form parameters
    are posted to an XSQL page, only the first value selected will be
    assigned to the corresponding XSQL parameter.
    This is very unfortunate, because I would like the selected values to
    be used in a query like this:
    <xsql:query>
    select ...
    from ...
    where ...
    and elem in ({@list})
    and ...
    </xsql:query>
    where 'list' is the name of the option selector. However, since only
    the first value selected is substituted, the query does not work.
    The <xsql:include-request-params/> will "rowify" the values selected,
    but this can only be utilized by a style sheet associated with the
    XSQL page.
    Does anyone know how to get access to all the selected values in the
    XSQL page?
    HELP!

    Hi,
    Here is an approach that may work for you.
    In the registration process, assign each individual a userid...  e.g. bob123.
    When they log into your site, create a SESSION variable, SESSION.userid = bob123.
    In your db, for every player have two fields, one is the userid of the person that is attached to that player, and another field for the jersey number.  You could also have a field for assigned/unassigned.
    Populate the grid with the unassigned players.  Have the empty jersey number field on the grid and make it editable.  When an individual assigns a jersey number to the person, (you can have them update after each person selected or at the end), you can let a cfc update the db and using their SESSION.userid, they become the "owner" of that player.  The update also will update the db with their jersey number.  The update can also turn them from unassigned to assigned so noone else can "claim" them.
    Now anytime the user logs in, they'll have their players, easy to get to using a WHERE sql statement = WHERE SESSION.userid = bob123.
    cfwild

  • Listbox with multiple selection in interactive forms

    Hello experts.
    I'd like to use a listbox in my form with enabled multiple selection.
    The form is part of a WebDynpro ABAP Application.
    Reading the context to get the content of the form fields works fine as long as I don't use a list box where
    multiple selection is enabled.
    When I use the box I only get the values of all other fields, but not the selected values of the box.
    My context node for the pdf looks like this:
    - *Node for PDF*  (Cardinality 1..1; Selection 0..1)
    -- Attribute 1
    -- Attribute2
    -- Node for Listbox (Cardinality 0..n; Selection 0..n)
    --- Attribute for Listbox
    Please help!
    Regards
    Frank
    Edited by: Frank Mueller on Feb 6, 2008 10:31 AM

    Hi,
    is there really nobody who knows, how to give more when one selected item of a list box back to ABAP?
    Please help!
    Regards
    Frank

  • Checked some items of multiple-selection list box when form loaded in infopath

    Hi
    I customize sharepoint list with infopath. I have multiple-selection list box and want to checked some items of that automatically when form loaded. how can do this?
    Thanks.

    Hi,
    According to your description, my understanding is that you want to pre-select some items in the Multiple-Selection List Box.
    I recommend to follow the steps below to achieve this goal:
    Click Default Values under Data tab in InfoPath, expand the dataFields and navigate to the Multiple-Selection List Box field.
    Set the Default Value of the Multiple-Selection List Box field.
    Right click the field under the Multiple-Selection List Box group, then select Add another Value Below and set the Default Value for this field.
    Repeat step3 based on the number of the items that you want to be pre-selected.
    More information are provided in the link below:
    http://www.bizsupportonline.net/infopath2010/pre-select-items-multiple-selection-list-box-infopath-2010.htm
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • How to "Performing an Action on Multiple Selected Records" using Struts-JSP

    Hi all:
    How to do "Performing an Action on Multiple Selected Records" through using Struts/JSP solution that is original MVC/UIX customizing example by Jheadstart.
    I know how to reason by analogy through tutorial guide on
    Model and Control layer of MVC , but for View layer that is torment to me !
    have any idea ?
    thanks a lot .

    Ting Rung,
    In the table in the JSP page you add a checkbox like this:
    <td class="fixed">
    <input type="checkbox" name="multiselect" value="<%=index%>"/>
    </td>
    This will render a checkbox in each row, with index number of that row as value.
    When you submit the page the request contains the multiselect parameter when at least one row has the checkbox checked.
    You can get the value of the multiselect parameter by calling sessionData.getRequestParameterValues("multiselect") in your action. The value is a string array containing the index numbers of the rows that have the checkboc checked.
    Steven Davelaar,
    JHeadstart Team.

  • Multiple Selects on Form

    Several questions about multiple selects on Forms.
    I want to create a form with a multiple select list. I know I can do this if I based the form off a table, correct? I mean, I try but the form does not allow me to put multiple selects on a form based off a table
    So what I did was create a procedure that has a parameter of type owa_text.vc_arr, but the form freaks out. It just hangs at "Retrieving Form Data".
    So, what gives? Can I use multiple select lists on forms? If not, why have them in Portal?
    Rich

    Hi Richard,
    In Portal it's not possible to create a form with a multiselect.
    Oracle has remove this feature from Webdb. Don't ask me why.
    The Multiselect is now only available for the parameter forms or reports. You can use them in a where clause like WHERE DEPTNO in :v_dept.
    Regards
    Arnoud

Maybe you are looking for

  • Fonts not appearing in InDesign

    Hi, Does anyone know why some fonts won't appear in InDesign even though they are in my Fonts folder on Local Disk?  I also tried putting a copy in the Fonts folder in InDesign, but they still don't appear in the program. Thanks, Jen

  • Tomahawk tree problem

    I am using the tomahawk tree. and I am using tiles. When I click the node, the page gets displayed, but When I see the url, I always see the last page url. How do I fix this ? thanks

  • PowerMac G4 has died, looking to upgrade

    Basically, my PowerMac G4 has died and I am looking at upgrading my machine. I have two options available to me; either a Powermac G5 quad 2.5Ghz processor with 5Gb of ram, or a 24" Intel iMac with a 2.17Ghz dual core processor and 2.5Gb of ram. I wi

  • Restrictions on Transactional Data using Access Control Engine

    Hi Experts, We are looking and implemting ACE to restrict visibility on Accounts and Transactions in our business. We are using CRM2007 We have an account which is located in 2 Sales Areas, Sales Area 1 and Sales Area2. As part of our requirement we

  • Comment installer icloud sur ipad 1 , IOS 5

    Bonjour, Je viens d'investir dans un ipad 1 g. Je n'arrive pas a installer la version icloud correspondant à IOS5. est ce possible ???? et comment? (notemment ibook). merci de vos réponses laetitia