This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Display same Data in JSP after reloading it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Display same Data in JSP after reloading it" Watch "Display same Data in JSP after reloading it" New topic
Author

Display same Data in JSP after reloading it

Dipti Lokhande
Greenhorn

Joined: May 05, 2007
Posts: 9
JSP is as follows :

Marks Details

Student Type : cboStudentType (combo box)
Student Name : cboStudentName (combo box)
Marks 1 : txtMar1 (text field)
Marks 2 : txtMar2 (text field)
Marks 3 : txtMar3 (text field)
Total : txtTotal(text field)

In above form , depending on selected student type, stident names will be fetched from the data table. After entering marks1, marks2 and marks3, Total should be calculated. Whenever total will be displayed, selected student type, student name and all marks should be restored back in the page.
Please do tell me how to achieve this?
viju vi
Greenhorn

Joined: Nov 15, 2007
Posts: 7
hi you can try doing this, this is one option give a onchange event to your combobox so that when a studenttype is selected trigger a javascript which send a request back to same page send the studenttype and while loading the page fetch the studenttype and send a database call to get the list of students data. and once this is done load the student names to the studentname combobox. similarly on selection of a particular student name send request to the same page by forwarding the type and name with it. and make a cal to fetch the marks, if no entry found load the input filed to enter and submit or else display the entered fields

your jsp will have following

thats all
[ December 06, 2007: Message edited by: Ben Souther ]

"No problem can be solved from the same level of consciousness that created it." Albert Einstein
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display same Data in JSP after reloading it
 
Similar Threads
problem when the jsp get refreshed
Keep the combobox entries after the form submission
How to set selected value to combobox after refreshing page
combo box issue in jsp
Problem in JSP with respect to combo box.