aspose file tools*
The moose likes JSP and the fly likes Use Select box (combobox) value on same page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Use Select box (combobox) value on same page" Watch "Use Select box (combobox) value on same page" New topic
Author

Use Select box (combobox) value on same page

Dustin Platter
Greenhorn

Joined: Sep 26, 2012
Posts: 7

Hello Moose Saloon,

I'm trying to teach myself several new Java centered technologies (due to my new position). However, my co-workers are under deadline so I'm on my own to get up to speed. I've been creating a test application to become more familiar with JSP and Servlets. This is what brings me here.
I have a SelectBox (I've read that it is NOT to be called a combobox :), with students names. Below several Text boxes, etc is a table which displays the students class schedule (built when form is submitted). The table is being created through the use of JSP and session variables. What I'd like is to determine which student is currently selected in the SelectBox and use that value in my JSP code that builds the table. Ultimately what I want is that when the selected student changes the table is rebuilt, displaying the newly selected students schedule.

Code snippets below


//I do something along these lines
SchoolSchedule allSchedule = Session.getAttribute("schoolSchedule");
SchoolClass myclass = allSchedule.getClass(studentname); //This is currently hardcoded. Need a way to base this off the selectBoxes value

Then I loop through myclasses building the <TABLE> as needed



So...
1) How do I simply display selected value(ie 'newStudent2') on the screen? (I've tried 'request.getAttribute("studentCB")' but just get null)
2) How can I build a <TABLE> to be displayed within my 'onChange' function?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use Select box (combobox) value on same page