Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listbox

 
rose hegde
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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
 
G Raghavan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
  • 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];
}}
 
jyothsna kumari
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic