How to do it?? in SELECT BOX

here is the bean class sample code of getting the result set from
database
public void setMembers2()
String query1="select e.idcode from employee e,wb_login w where e.idcode=w.idcode ";
stmt1=conn1.createStatement();
rs1=stmt1.executeQuery(query1);
System.out.println("Executed query");
if(rs1.next())
do{
id=rs1.getString(1);
System.out.println("THE IDCODE IS JAVA "+id);
setId_code(id);
} while(rs1.next());
else
System.out.println("THE IDCODES ");
here is the sample code in jsp i have to populate the Idcode's in SELECT BOX
<select name="idcode" size="1" >
<%
String str1="";
promotionbn.setMembers2();
str1=promotionbn.getId_code();
System.out.println("THE IDCODE IN JSP PAGE IS "+str1);
%>
<option value="<%=str1%>"> <%=str1%>
</select>
But in the select box priniting only one record.........

Hey,
Where are u defining the get/set methods method ??. The code u gave is not very clear. Acording to what u gave below it will surely print only one record probably the last one.
KM
here is the bean class sample code of getting the
result set from
database
public void setMembers2()
String query1="select e.idcode from employee
e,wb_login w where e.idcode=w.idcode ";
stmt1=conn1.createStatement();
rs1=stmt1.executeQuery(query1);
System.out.println("Executed query");
if(rs1.next())
do{
id=rs1.getString(1);
System.out.println("THE IDCODE IS JAVA
CODE IS JAVA "+id);
setId_code(id);
} while(rs1.next());
else
System.out.println("THE IDCODES ");
here is the sample code in jsp i have to populate the
Idcode's in SELECT BOX
<select name="idcode" size="1" >
<%
String str1="";
promotionbn.setMembers2();
str1=promotionbn.getId_code();
System.out.println("THE IDCODE IN JSP PAGE IS
"+str1);
%>
<option value="<%=str1%>"> <%=str1%>
</select>
But in the select box priniting only one
record.........

Similar Messages

  • Selection Box Issues

    Hi folks, this is probably a dumb question but I've looked everywhere online without an answer:
    How can I draw a selection box over 1 or more objects without selecting objects that touch the selection box? - I.e. as an example: in Autocad when you draw a selection box from left to right it only selects what's inside the box, and when you draw it from right to left it selects everything that crosses in and through the selection box... In illustrator I'd like to be able to select only what's inside the box and not what crosses it?
    Apologies if i've confused the issue, I'm a little tired! :-)

    It's not a dumb question, Illustrator just doesn't work that way. You may want to request the feature here.
    "Normal, direct or group" selection tools along with "Shift-clicking" to toggle selections, is the standard approach.
    Also, the Selection Marque tool may help you.
    Finally, effective use of groups, layers and symbols, can greatly simplify selection challenges.

  • How can I see the numbers of lines selected in a Multiple Selection Box?

    Hi everybody,
    what I want to do is to get in an array of numbers all the lines selected.
    For instance, if I select the rows 1,4 and 7 from a Multiple Selection Box
    of 10 rows in total, how can I see that array when the rows 1,4 and 7 are
    selected?
    Because I want to connect this numbers to Case Structure and if the only
    rows selected are 1,4 and 7, the Case Structure will only realize this cases,
    and the rest will be ignored.
    I'm sure there is some way to get what I want.
    Thank you for your helpful.

    THANK YOU VERY MUCH. IT WORKS PERFECTLY!!!
    "Dennis Knutson" wrote:
    >>If you just wire the list box to an array indicator, you will see that
    the>output is an array of the selected items. Auto index the array through
    a>for loop that has your case statement inside.>>Dennis Knutson>>"Carlos
    Jorge" wrote>>Hi everybody,>>what I want to do is to
    get in an array of numbers all the>lines selected.>For instance, if I select
    the rows 1,4 and 7 from a Multiple>Selection Box>of 10 rows in total, how
    can I see that array when the rows>1,4 and 7 are>selected?>>Because I want
    to connect this numbers to Case Structure>and if the only>rows selected are
    1,4 and 7, the Case Structure will only>realize this cases,>and
    the rest
    will be ignored.>>I'm sure there is some>way to get what I want.>>Thank you
    for your helpful.>>

  • How can I access the selected element of a DropDownByIndex-box?

    Hi,
    I want to create a WebDynpro with two web services. I created the first request with the first web service and the results are displayed in a DropDownByIndex-Box. Now the user should choose one of the results and I would like to use this for the request with my second web service. How can I access the selected Element of a DropDownByIndexBox in the Code?
    Thank you!!
    Julia

    Hi Julia,
    when user select one element in drop down it automatically set lead selection of node binded to dropdown.
    For example if you bind a dropdown to node myNode with value attribute myAttribute the lead selection of node myNode is set in the position of element choose from user.
    So to take this chooised element use this code:
    wdContext.currentMyNodeElement.getmyAttribute()
    bye
    Andrea

  • How to populate optional items in SELECT BOX

    // REGISTRATION.JSP//
    <%@ page import="java.util.Enumeration" %>
    <%@ page import="java.util.Vector" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.lang.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="beans.register2" %>
    <jsp:useBean id="registerbn" scope= "session" class="beans.register2" />
    <% String base = (String) session.getAttribute("base");
    registerbn.setDburl((String)session.getAttribute("dbUrl"));
    registerbn.setDbuser((String)session.getAttribute("dbUserName"));
    registerbn.setDbpasswd((String)session.getAttribute("dbPassword"));
    System.out.println("Inside jsp - setMembers of promotion successful");
    registerbn.setMembers();
    System.out.println("after setting");
    %>
    <%
    String action=request.getParameter("action");
    %>
    <HTML>
    <HEAD>
    <TITLE> TIFR INTRANET </TITLE>
    </HEAD>
    <HEAD>
    <script language="_JavaScript1.2">
    function isIdcode()
    / validating
    function isUser()
    / validating
    function isEmail()
    / validating
    function isPassword()
    / validating
    function isDob()
    / validating
    </javascript> -----java script ends here----------------
    <TD align="top" valign="top"><jsp:include page="menu.jsp" flush="true"/>
    </td>
    <td>
    <table cellpadding="2" cellspacing="3" width="40%">
    <form method="post" action="./beans.register2">
    Fisrt question: we have creaated "register2.java "as beans class for setting the values in to the data base.
    is it correct ?
    <td width="40" align="center"
    <font face="arial" size="5" align="right">
    <b>
    Registration <hr> </hr>
    </b>
    </font>
    <br>
    </td>
    <tr valign="center" width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">IdCode </b> </font>
    </td>
    <td width="40%">
    <b><font face="Arial" size="2">
    <input type="text" name="idcode" size="6" style="border-style:solid" value="">
    </font></b>
    </td>
    </tr>
    <tr width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">User </font></B></td>
    <td width="40%">
    <input type="text" name="user" size="12" style="border-style: solid" value="">
    </font></b></td>
    </tr>
    <tr width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">Password </font></B></td>
    <td width="40%">
    <input type="password" name="password" size="25" tabindex="20" style="border-style: solid" width="12" value="">
    </font></b></td>
    </tr>
    <tr width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">Section code </font></b></td>
    <td width="40%">
    <select size="1" name="section_code" tabindex="9"
    style="border-style: solid">
    <%@ include file="section.txt" %>
    Secound question:
    // inclided simple .txt file here
    // what if new item get enlisted in the database , we have to countinuesly update this .txt file ? so we head for creating simple beans class for retriving values
    then displaying in the SELECT box
    // we dont know how to do it.
    //other html tags //
    ----------------at end -----------------
    <input type="Submit" value="Submit" name="B1" > </td>
    <td width="40%">
    <input type="reset" value="Reset" name="B2"></td>
    <%
    String action=request.getParameter("Submit");
    if(action!=null && action.equals("Submit"))
    try{
    String idcode=request.getParameter("idcode");
    String user=request.getParameter("user");
    String password=request.getParameter("password");
    String seccode=request.getParameter("section_code");
    String Category=request.getParameter("Category");
    String BCategory=request.getParameter("BCategory");
    String Bheads=request.getParameter("Bheads");
    String OtherCategory=request.getParameter("OtherCategory");
    String email=request.getParameter("email");
    String day=request.getParameter("day");
    String month=request.getParameter("month");
    String year=request.getParameter("year");
    String Dob=day+"/"+month+"/"+year;
    String day1=request.getParameter("day1");
    String month1=request.getParameter("month1");
    String year1=request.getParameter("year1");
    String Doj=day1+"/"+month1+"/"+year1;
    registerbn.setIdcode("idcode");
    registerbn.setUser("user");
    registerbn.setPassword("password");
    registerbn.setSec_code("seccode");
    registerbn.setCategory("Category");
    registerbn.setBut_Category("BCategory");
    registerbn.setBut_heada("Bheads");
    registerbn.setOther_Category("OtherCategory");
    registerbn.setemail("email");
    registerbn.setDob("Dob");
    registerbn.setDoj("Doj");
    registerbn.saveData();
    /// saveData() is the one method where we are wrintn query to insert in to database//
    }catch(Exception ex)
    out.println("ERROR :has occured ");
    %>
    </table>
    </table>
    </table>
    </form>
    </td>
    </tr>
    <jsp include page="Footer.jsp" flush="true"/>

    To do that you have to get your recordset, and insert option tags into a while cicle. Something like this:
    <select name="mySelectName">
    <%while(myRecordSet.next()){%>
    <option value="<%=myRecordset.getObject(myField1)>"><%=myRecordset.getObject(myField2)%></option>
    <%}%>
    </select>

  • How to populate select boxes in custom work flows?

    We are trying to create a workflow that allows users to select a few item details from a select box inside the form. I created the select box but I can't figure out how to populate it with elements. I've been reluctant to post here because this question seems so straight forward but I haven't been able to find the answer and don't want waste more time searching for this answer. Please help!
    Thanks,
    Richard

    Sorry for the trouble, I found the answer. I was looking in all the wrong places. Thanks anyway!
    Richard

  • How to create editable select box in jsp page

    hi,
    i got som peculiar requirement in my jsp page.i have my page like this.
    <html>
    <body>
    <form name="test">
    <select name="test">
    <option value="one">USA</option>
    <option value="two">India</option>
    <option value="three">UAE</option>
    </select>
    </body>
    </html>
    this is one of the select box in my jsp page.
    now i want to change the look and feel of select box..
    1-dont want to show the scrollbar means the right side arrow which allows to see the total options in select box.
    it should look like normal text box.
    2-roveer apert from the existing values if there is no matching value user must be allowed to enter his own value in above select box..
    how i can solve this problen..
    regards,
    sam

    Is that maybe a browser memory auto-complete thing? It works on Netscape 7.2. But no, it's not a browser auto-complete thing (does NS have that? IE does... either way, I would've disabled that). It's definitely a Javascript trick, I'm sure of that. I know I haven't sent mail to all people in my address book from my work PC, but it doesn't stop them from showing in the list as I type...
    Unless there is a special HTML tag option or browser extension that I've never heard of that allows you to supply a set of values to a text input field for auto-completion (as opposed to the browser remembering what was typed).

  • How to update database with a select box

    I'm hoping someone can/will help me with a new feature I'm
    trying to add to my web site. I'll summarize what I'm working with
    and then proceed to what I'd like to do. This is the web site I'm
    working on: www.truckerstoystore.net
    I have a database for the Truck of the Week set up with the
    information that is output on each page in the left column and
    on the Truck of the week page itself. I add new Truck of the
    Week (TOW) entries via a form I've put together. Right now, in
    order to change the current TOW, I have to manually go into my
    template and change the ID (which is automatically assigned when
    the record is created, and thus makes it unique) in my SQL which
    currently reads
    SELECT *
    FROM truckofweek
    WHERE ID="4"
    to the ID of the current TOW.
    What I want to be able to do is create a new form that will
    allow me to select the TOW entry that I want to be displayed from a
    select box (drop down box). I have a good idea of how to populate
    my select box, but don't know how to get it to work. My first idea
    was to update the table in the database (Access) manually with a
    new column called currentTOW, with values set to a Yes/No type,
    with default values set to "No". Then I would use my form to set
    the value for one of them to "Yes" so I could set my SQL to 'WHERE
    currentTOW ="yes" ' I would also make a <cfif> statement that
    checks for entries marked "Yes" and changes them to "No" when the
    form loads to avoid setting 2 entries to "Yes" and my page thus
    attempting to load 2 TOW entries.
    My problem is, I don't know how to do any of this. I hope
    I've described this situation well enough. I know there has to be
    at least one guru on here that can help me. Any assistance would be
    greatly appreciated.

    Hey,
    Thanks for replying. That sounds like a good idea, but I
    don't know how to do it.
    I started working on a new idea, where I have a second table
    in the same datasource set up called currentTOW, with one field
    called currentTOW and only one record. The idea is to send the
    string of the "owner" field from the select box, which is populated
    from the table called truckofweek to this one cell in the
    currentTOW table.
    This way, in my page which will display the data, I have 2
    querys. The first pulls the data in the single cell from currentTOW
    and outputs its string into the second query. I've attached the
    code below. I get an error when I try to display the page, see the
    error here:
    www.truckerstoystore.net/currentTOW2.cfm.
    However, the SQL looks like I want it to look, as "WHERE Owner =
    Craig Carp" is essentially the same record that it displays now in
    the live page "/currentTOW.cfm" only the SQL currently reads "WHERE
    ID = 4" (4 and Craig Carp are part of the same record).
    Here is the link to my form:
    Form

  • How to retreive mutiple values from select boxes in jsp

    <select name="indices" style="width:180" size="6">
                             <option value=F_ARCHIVEDATE> F_ARCHIVEDATE </option>           
                   <option value=F_DELETEDATE> F_DELETEDATE </option>           
                   <option value=F_DOCCLASSNUMBER> F_DOCCLASSNUMBER </option>           
                   <option value=F_DOCFORMAT> F_DOCFORMAT </option>           
                   <option value=F_DOCLOCATION> F_DOCLOCATION </option>           
                   <option value=F_DOCNUMBER> F_DOCNUMBER </option>           
                   <option value=F_DOCTYPE> F_DOCTYPE </option>           
                   <option value=F_ENTRYDATE> F_ENTRYDATE </option>           
                   <option value=F_PAGES> F_PAGES </option>           
                   <option value=F_RETENOFFSET> F_RETENOFFSET </option>           
                   <option value=date1> date1 </option>
    <option value=id> id </option>
    <option value=name> name </option>
              </select>..
    hi iam having a select box with above option values..when we submitt the page i want retreive all these option values in anohter jsp called retreive.jsp..how can i do that..i want to put all these values in array in that jsp page..
    regards,
    sam

    Hi
    In ur code u cant select multiple values. Alter ur code like this
    <select name="indices" style="width:180" size="6" multiple> // multiple added here
    <option value=F_ARCHIVEDATE> F_ARCHIVEDATE </option>
    <option value=F_DELETEDATE> F_DELETEDATE </option>
    <option value=F_DOCCLASSNUMBER> F_DOCCLASSNUMBER </option>
    <option value=F_DOCFORMAT> F_DOCFORMAT </option>
    <option value=F_DOCLOCATION> F_DOCLOCATION </option>
    <option value=F_DOCNUMBER> F_DOCNUMBER </option>
    <option value=F_DOCTYPE> F_DOCTYPE </option>
    <option value=F_ENTRYDATE> F_ENTRYDATE </option>
    <option value=F_PAGES> F_PAGES </option>
    <option value=F_RETENOFFSET> F_RETENOFFSET </option>
    <option value=date1> date1 </option>
    <option value=id> id </option>
    <option value=name> name </option>
    </select>..
    in retrieve.jsp write like this
    <% String[] mv =request.getParameterValues("indices"); %>
    <% for(int i=0; i<mv.length;i++)
    {     %>
    <br>
    <%= mv[i] %>
    <% }
    %>
    I hope it will satisfy u :)

  • How can I validate a multi-select box to have at least 1 option

    How can I validate a multi-select box to have at least 1 option
    selected in struts?

    thanks i will try that other then that if I want to create single drop down list and pass multiple values associated to that drop list value how would i do that....

  • How to Populate values dynamically in Select Box.

    Hi All,
    I have few select boxes in my webdynpro application. Right now I am populating them using Harcoded values in the Dictionary. But I dont want to harcode the values in the dictionary, i want pull the values from database tables or  text files of EP KM. Just let me know which is the better way to populate the select box without hardcoding & why ?
    Thanks in Advance.
    Regards,
    Aditya Metukul

    Hi Aditya,
    Getting values from KM and database is possible
    It depends on your requirement
    ie if the dropdown should contain details of documents from KM or it should display the details in a table
    if it is oracle table see this link
    Webdynpro and Oracle
    if you want to get data from km see this tutorial
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on using knowledge management functions in web dynpro - 26.htm
    Hope this helps you
    Regards
    Rohit
    Regards
    Rohit

  • How to get System status Check Boxes into Query selection screen

    Dear experts,
    Pleas help in knowing how to get System status Check Boxes into quick view query (SQVI), selectionscreen.
    Regards
    Jogeswara Rao
    Edited by: K Jogeswara Rao on Jul 6, 2010 7:26 PM

    Problem solved through other Forum
    (Checkboxes not possible, some alternative solution to my requirement found)

  • How disable smartcut  section select box? Wayne help needed!

    Dear friends
    I disable smartcut section select box with Toolbar=Navigation parameter in link
    http://localhost:45000/workspace/browse/get/KursHYP2008/siyavus/BimR.bqy&user=admin&pass=password&Toolbar=Navigation
    but when I login in LoginDash and activate another section, the section select box is activated on menu again!
    regards

    Can you be a little more descriptive on what you need here and explain what exactly you want to be changed.

  • How To Hide Time Selection Box from Advance Date Filter in Powerview

    Hi Experts,
    Is there any way to hide Time Selection box appearing in Advance Filter mode for Dates in PowerView??
    Thanks and Regards,
    Mukesh Singh

    Hi Mukesh,
    We can click the Advanced Filter Mode icon on the first to the right of the field name in the Filters area to switch between basic and advanced filters modes. At this time, we can select date and time in the selection box. But there is no such feature for
    us to hide the time selection box in current release of Power View.
    As per my understanding, we can select a time that has no impact on the data in the time selection box to work around this issue.
    Thank you for your understanding.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to fill selection box with clientside data?

    i want to make a html form that reads option values from the client.
    Because there are too many data, it's not reasonable for me to design a page which connects to server each time to fill the selection boxes.Instead i want to check if data resides at the clientside, if so fill selection boxes with that data, if not download it for the first time and store it on the client for later local retrieval.In addition i must be able to update that data residing on the client when i want.

    Hi,
    I can tell you some hints. Use cookies to store the information on to the client-side. You can read data from cookies using JavaScript. If you want to store huge amount of data on to the client-side, perhaps this would not be a better idea. In J2EE architecture we often use sessions to store values. You need to design your implementation in such a way that for the first time you fetch all the values from the database and put it in a session, and the next time onwards you can get the values from the session itself and thereby you can avoid going to database each and everytime. Write a Java class which has all the necessary get and set methods and store the object in the session. Using that object reference you can set and get the values from it. I hope this will help you.
    Thanks

Maybe you are looking for

  • Shared Mailbox folders missing in Outlook Cached Mode

    Since I got no responses to my original post in section, "Exchange Server 2013 - Sharing and Collaboration: Site Mailboxes and Public Folders" I'll give it a try here... We have Exchange 2013 Server (Version 15.0 - Build 913.22).  I have a shared mai

  • 1 ipod to 2 macs eg imac g5 and macbook

    hi could i ask for some help please i want to make my ipod work with my new macbook it works ok with my imac bacically want the library both the same regards gary if you get a minute

  • Need different kinds of query's  for same result

    Hi all, I need a query for the following scenario,the query which i mentioned below is giving me result as i need,i would like to know whether there are any other better ways to get the same result. create table xxeaccess (client_name varchar2(100),

  • How to arrange textfield in vertical way in a panel???

    Suppose I want to arrange textfield text1, text2 and text3 in a panel so that text1 is in the first line and text2 in the second line and text3 in the third. How can I make this? Thank you.

  • How to see flash player videos?

    How to see flash player videos? When I try it, I get an error message ...Thanks for your help