Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Struts form tabs

Posted on 2007-03-24
2
Medium Priority
?
3,023 Views
Last Modified: 2013-11-24
Hi ,
I am new to struts and i have to work in a project which have  a form which will  have 6 to 8 tabs. I would like to save the data when i move to another tab also could some one pls let me know how to design the project using struts???i also want to do some serverside validatons using validation frame work.
pls let me know all the steps in order  so that i can follow in my desgning and coding .
Thx and Regards
0
Comment
Question by:sreddy_k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 30

Expert Comment

by:Mayank S
ID: 18786013
>> I would like to save the data when i move to another tab

You can hit a servlet through a Javascript method when the user clicks on another tab and the servlet can store the data in the HttpSession object. If you want to save to a DB later after all tabs are processed, you can retrieve the object from session and save it to a DB.

>> i also want to do some serverside validatons using validation frame work.

See the tutorial at: http://www.roseindia.net/struts/struts_validator_framework.shtml
0
 
LVL 9

Accepted Solution

by:
nimaig earned 2000 total points
ID: 18917175
I would suggest you to have
1. Different ActionForm for different tabs : Reason being that each tab will differ in contents and it would be tough to handle and manage too much data in a single ActionForm.
2. You can have a single Action class to handle all the business logic / flow.
3. Have 2 buttons for each page 'Save' & 'Save & Exit'. 'Save' button can save the data and let the user be in the same tab. 'Save & Exit' will save the data and take the user to the main/master tab (may be the 1st tab).
4. Have a mechanism in the frontend (using JavaScript) to check if the user has modified any data in the screen (You can get free code in the net to do so). If the user has modified some data, while the user tries to change the tab, popup a javascript confirmation box asking something like this 'Data has been modified in this page. Do you want to save and proceed?'.
5. If the user opts for 'Saving', then save the data to the DB directly.
6. Load the data from the Data Source (say for ex. Database) each time the user visit the page/tab (i.e. clicks the tab).

Hope this helps.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question