Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

how to select multiple items in listbox througth code in jsp page

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I was writing a jsp page in which I have to search for the number of records for the given email-id. I have fileds like name,companyname,website and technology. All the fileds are textboxes except technology. Technology field is listbox.

What I am trying to do is when i search a record for a given email-id. If the record exists with the given mail-id,I succeeded to populate the information and I am able to display the data in the corresponding textboxes. But iam unable to do it for technology listbox. there may be multiple technologies(records) for the same mail-id.

I am unable to select the items in the technology listbox after populating the information from database.

can anybody help?

thanks
yerra reddy
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint #1: If you were writing the page in raw HTML how would you do it?
 
yerra reddy gatla
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your response..

I am writing it in a jsp page only,not in raw html.

After entering email-id and press search, I am able to display name,companyname and website etc in the corresponding textboxes. And I got technologies of that particular email id into an array.

Now I have to select the technologies in the listbox with the technologies i have in the array(means technologies of that particular email id).

I think my problem understood.

anybody help me about how to select technologies in the listbox corresponding to the records in the database.

it's urgent..

thanks
yerra reddy
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by yerra reddy gatla:


But iam unable to do it for technology listbox. there may be multiple technologies(records) for the same mail-id.

I am unable to select the items in the technology listbox after populating the information from database.



your question is not clear.

Are you unable to populate data in list box ?
or
You are able to populate data in list box but unable to select data after populating it.

populating data in list box and selecting data from list box are both different requirement. What's is your requirement
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am writing it in a jsp page only,not in raw html.


Bear's hint is still a good one. Ultimately, regardless of what technology you have chosen to write your applicaiton in (JSP, ASP, PHP, etc. ) its end product will be HTML, since that what the browser will render. So, ignoring the fact you will generate your HTML with a JSP, can you write this in HTML?
 
yerra reddy gatla
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Latha,

I am able to get the technologies that are retrieved from database into an array in jsp code.But how to select or highlight those technologies in listbox?
I hope u understood my doubt.If u need any clarifications,plz let me know.
Please try to give solution
bye
reddy
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTML is often (and should be) a pre-requisite to web development.

If you don't already know the basics of HTML, it might be good idea to step back and spend a day or two learning it.

This chapter in Core Servlets and Java Server Pages is nice because it goes over this from a JSP developer's prospective:
http://pdf.coreservlets.com/CSAJSP-Chapter16.pdf
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic