You can work with one form to display/insert the data. Because you
populate your form in the action class.
I would validate your form data in the action and then pass the form to
a special DAO Object which handles the SQL Statements, including transaction
handling. This means you need the following classes/jsp
PrepareAction extends Action
|
display.jsp
|
CheckFormAction extends Action
|
DAO Object which manipulates the data in the database or throws an
exception when
transaction was interrupted
-----Ursprungliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 4. Marz 2002 18:11
An: Struts Users Mailing List
Betreff: Advice requested, what's the best way to mimic tab panes in
Struts?
Hi Folks:
We're converting much of our GUI (written in JFC/Swing) to thin client
using HTML-JavaScript and the struts framework.
I have converted a few of the simpler maintenance screens using the
framework and (thanks to you all) have learned quite a bit with struts.
There is a screen that I need to convert though which has 5 panes in a
JTabbedPane control. Each pane refers to input in a different table but
all 5 panes together serve to obtain information about a Process Setup for
claims. So in other words, you fill out the info for all 5 tabs and when
you hit "Ok", required field checks are performed. If required fields are
ok, then data is gathered from each tab and the corresponding table is
updated for a total of 5 tables. But they all belong to the same SQL
transaction. So it is not valid to update just 1 of the 5 tables. It's
either all or none. So if the update/insert fails on any of the 5
tables, then the whole transaction is rolled back and the user is informed
of the problem.
With the JFC/Swing architecture, this is pretty easy to do. With struts
it seems different. Do I need to have 5 forms (each form mimicing a tab)
with a hyperlink of image files that look like tabs but have href's to the
5 different forms?
Here's my problem:
- Don't forms need to have a Submit button? If so, I can't do this. I
need to have 5 forms but one submit so that all 5 forms share the same
submit button (the 1 submit button would cause an action to take data off
of the 5 pages (or forms) and populate the tables directly.
What would be the best way to do this? I can't use a wizard as the user
needs to be able to flip back and forth at will thru any of the 5 forms
before they hit the final "submit" button.
thanks,
Theron
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>