This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes JSP with tabs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP with tabs" Watch "JSP with tabs" New topic
Author

JSP with tabs

Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
I have been asked to develop a JSP application. Basically it consists of one screens with 7 tabs. Each of these tabs are divided in two section. The top section will have search criteria and bottom will have result set
as master details or simply master only. They will do insert/update/delete etc and screens have standard controls like list box, radio buttons, check boxes etc. It is fairly GUI.
I was intending to use BC4J and JSP combination, BC4J comes part of Jdeveloper(Oracle product). But client told me to not use BC4J as this
will make them dependent on Oracle suite. The application needs to be
independent of third party classes(anything from Open source is fine though).
Any idea how can I do this? I belive JSP will be the way to go. Is there an
IDE I can use to keep coding minimum. What I have seen is that JSP means a lot of code... we have only 3/4 weeks to do this.

Any clues/help will be appreciated.
Thanks
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
it's possible.
You need a piece of Javascript that submits the requests and loads the results into a div which represents the tab.
We've created something like that last year and it works well (code is proprietary, sorry).
It DID take longer than 3-4 weeks to get it working properly and code the application around it. If that's your deadline you're out of luck, if you have a star Javascript programmer you might get the code in time but you won't have time to get it all integrated and tested.
Another option would be to submit everything every time a new tab is requested. This is easier to build.
We decided against it as it makes the screen flicker (for a moment depending on connection speed your browser screen will go blank when a new page is loading, this is normal but not what users expect in a tabbed screen).
You can keep track via a request parameter which tab has been requested and load only that via a c:choose tag.


42
Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
I was looking at JSP option not using Java script. From your post seems you used Java script.Is that right? We are lookig at Vanilla solution, no depenednies on Oracle provided BC4J etc.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61071
    
  66

Since JSP is merely a templating technology used to create HTML pages to be sent to the browser, your tabs need to be rendered using HTML. Your JSPs can help dynamically format the HTML that is sent to the browser, but it all comes down to plain old vanilla HTML.
If you do not want to use Javascript to control the "tabbing" on the client side, then you will need to resubmit and redraw the page to implement the tab switching.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
Bear is right.
In addition to his comment I would like to add that you may need to design a custom tag that takes care of the tab traversal(that can retain the overall parameters of your submit).
And if you take that approach it is not black and white. Where I come from, when I refer to the code that accomplishes this issue, it is not easy to implement as a reasonably generic tag.
Kishore.


Kishore
SCJP, blog
brad balmer
Ranch Hand

Joined: Mar 08, 2004
Posts: 57
Take a look at struts-menu:
http://sourceforge.net/projects/struts-menu/
It uses javascript and cookies to accomplish it's tasks. I was easily able to extract out what I wanted and write my own tag that doesn't use javascript (Sorry, can't give out the code).
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Yes, we went with a Javascript solution.
There's a JSP that has a DIV on it which serves as the tabcontrol with some nested divs to hold the tab headers and the data).
When the user clicks a tab header Javascript loads another JSP and insert the generated HTML into the innerHTML of the inner DIV, giving the appearance of a new tab being opened (especially as it also changes the colours and borders of the tab headings to give the appearance of a standard Windows tabbed dialog).
The Javascript takes care of submitting formdata as well.
A similar solution could be coded in all JSP as well of course, but would require the entire page to be sent back and rebuilt every time another tab is selected, something we didn't want.
sun ram
Ranch Hand

Joined: Dec 18, 2001
Posts: 61
Use JSP 2.0 you can reduce lot of coding. also look at this
http://www.common-controls.com/en/products/
product, this will give you some idea.
SR


SCSecA,SCNA,SCSA,SCWCD,SCJP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP with tabs