The moose likes HTML, CSS and JavaScript and the fly likes Auto-refresh JSP on control selection? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Auto-refresh JSP on control selection?" Watch "Auto-refresh JSP on control selection?" New topic
Author

Auto-refresh JSP on control selection?

Tak Lee
Greenhorn

Joined: Apr 09, 2004
Posts: 2
I have a combo box of names and below it, a data grid. What I would like to do is have the user select a name from the combo box, the page refreshes and the data grid populates with information based on the selected user.
Is this easy to do? What's the code like that performs a page refresh on a control selection?
Any help is definitely appreciate.
Thanks.
[ April 09, 2004: Message edited by: Tak Lee ]
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50677

JSP has no client-side control facilities. You need Javascript on the page. As such. moving this to the HTML/Javascript forum.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
you can submit a form...
onchange="document.form.name.submit()"
then you can use the dropdown element's value to populate your grid
Warren Dew
blacksmith
Ranch Hand

Joined: Mar 04, 2004
Posts: 1328
Within the <select> tag, add an onchange attribute that references a javascript function to reload the page or submit the form, something like <select onchange="javascript:submit_form()" ... >. It's good to add a "go" button that also submits the form for people who have javascript turned off.
Tak Lee
Greenhorn

Joined: Apr 09, 2004
Posts: 2
Thanks!
I kept thinking it was a JSP thing...
 
 
subject: Auto-refresh JSP on control selection?
 
Threads others viewed
ASP with JavaScript
Combobox Problem
Performance Tuning-Rendering taking lot of time
Servlet getting values from a combo box
ask for the pass value
developer file tools