It's not a secret anymore!*
The moose likes HTML, CSS and JavaScript and the fly likes tabs in JSP and passing values between tabs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "tabs in JSP and passing values between tabs" Watch "tabs in JSP and passing values between tabs" New topic
Author

tabs in JSP and passing values between tabs

Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
Hi,

I am doing one project with JSP,Servlet and Oracle DB. First I want to design a tab in JSP, not using Swing or AWT. I had searched in gogle, and got some idea. Now I am coming to my problem.
I will be having 5 tabs and each tab will have 12 to 15 text boxs. The user can fill the fields in the each tab some may be optional , when he filled all the fields in the tab and on clicking the submit button, all the values from the 5 tabs should enter into the Oracle DB.
How to achieve it without any performance hit. PLease give me some idea on it. if any of you come across soln for this with sample codings in the net, it will be useful.
I am still searching in net and reading some documents related to this.

The reason I'm posting in this forum is, this forum has many active members who can solve/given some ideas in it before.

[Bear edit: what's with the all caps?]
[ March 04, 2006: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Arranging the various layers into tabs is a simple matter of HTML and CSS and has no JSP dimension to it. As such, this has been moved tothe HTML forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
Hi,

I had searched in gogle, and got some idea. Now I am coming to my problem.


My problem is not with how to design tab. I already mentioned that I had got some tips for the tabs. But what my problem is, how to get the value from each tab and while submit, all the values from all the tabs should be stored in the DB.

In a normal sceneario, we can get the value from the form by using getParameter to the servlet and then store it ti the DB. But here I am having 5 tabs and each tab will have several text fields.

Supposing I am having three tabs namely, T1,T2,T3

T1 - T1 is a tab and it has a form with some text fields. I am filling the fields and after that I am going to tab T2.

T2 - T2 is an another tab with some text fields and i am filling that to & same for tab T3.

Now I am at Tab T3 with the values from the Tab T3, how can I get the values from the tabs T1 and T2. SInce I want to store is DB with all the values from tabs T1, T2 and T3. Whether we can store the values from T1 and T2 in the page scope or request scope or session scope. We don't know in which order the user is going to fill the fields in the tabs.

When the user fills the text fields in one of the tab T1 and store all the values in the session and similarly to T2 and T3 and finally submitting we can get it from the session and store it in the DB.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

There is no reason that all of the fields on all of the tabs cannot be part of a single form that is submitted to the server when the form is submitted.

Unless there's something you're not telling us. Is there any reason that a server hit needs to be made when "switching" between tabs?
Alex Kravets
Ranch Hand

Joined: Jan 24, 2001
Posts: 476
Mark,

Check this out: http://webfx.eae.net/dhtml/tabpane/tabpane.html

This is a good implementation of tab panes in dhtml and it has good JavaScript API.


All right brain, you don't like me and I don't like you, but let's just do this one thing so I can get back to killing you with beer.<br /> <br />- Homer Simpson
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tabs in JSP and passing values between tabs
 
Similar Threads
Struts2 - Conditional validation
jQuery tabs UI issue
Passing hidden fields between 5 different pages
Tabbed menus - jsp
Keeping url short and relative