• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Listbox

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
Thanx
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
regards,
Raghavan
 
rose hegde
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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 passing..in 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()
{
try{
rs=sttnew.executeQuery("select * from dte_leave_transaction where sl_no = 1");
while (rs.next())
{
recemponly = new String[1][16];
if (rs.getInt(1)!=0)
{

for(int j=0;j<16;j++)
recemponly[0][j]=rs.getString(j+1);
}
}
}catch (Exception e )
{
System.out.println(e.getMessage());
}
public String getemprecordonly(int index1,int index2)
{
return recemponly[index1][index2];
}}
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai rose,
in a list box u can get the selected index which the user has choosed.as
"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.
jyothsna
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic