File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Listbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Listbox " Watch "Listbox " New topic


rose hegde
Ranch Hand

Joined: Oct 22, 2003
Posts: 40
I have a popup window where user searches for a name from database and names starting with the alphabet will all be displayed in a listbox.
Than when the user clicks on employee name displayed in listbox all details pertaining to him should appear in the parent screen.
I can search and display employee names but than when i click the name for details of the employee to be displayed i get error.
So can anyone tell me how to do this?
G Raghavan

Joined: Aug 21, 2000
Posts: 15
What is the error that you get. if put the code it will be better.
I hope this suggesstion works. Put the employee name or ID which ever is unique in a session variable and pass it to the jsp page of the parent window.

G Raghavan
rose hegde
Ranch Hand

Joined: Oct 22, 2003
Posts: 40
this is the java code i am pasting..
now in the table i have a unique field called sl_no and thats what i am the code i have hard coded and given value 1...but how to pass value of the user selected value from list box in front end..pls help...
public void empdisplayRecords()
rs=sttnew.executeQuery("select * from dte_leave_transaction where sl_no = 1");
while (
recemponly = new String[1][16];
if (rs.getInt(1)!=0)

for(int j=0;j<16;j++)
}catch (Exception e )
public String getemprecordonly(int index1,int index2)
return recemponly[index1][index2];
jyothsna kumari
Ranch Hand

Joined: Jul 21, 2003
Posts: 108
hai rose,
in a list box u can get the selected index which the user has
"document.form.listbox.selectedIndex".from this selected index u get the corresponding id value and place it in a session variable and send to server.from there i think u can do the remaining work.
I agree. Here's the link:
subject: Listbox
jQuery in Action, 3rd edition