Tab Panes
Hi, I'm currently implementing a form with quite a lot of values separated into several categories, and from regular GUI experience I'd like to use some kind of tab panes. I'm implementing it with struts 1.0.2 on BEA Weblogic and have run into some problems. My basic idea is to use a single form bean as the backend and one jsp for every pane. Now when the user clicks on a pane rider, it should do two things: forward to the new page and submit the values from the form. The forwarding works, I just use a html:link with the form action and the action class forwards to the correct pane according to paramId and paramName. But it just won't seem to submit. Isn't onclick=document.forms[0].submit(); enough? It looks like this: JSP: h:link href=/dada.do paramId=newTab paramName=oneTab onclick=document.forms[0].submit() Config: action path=/dada type=com.consol.DadaAction name=DadaForm scope=session input=/newone.jsp forward name=goOne path=/newone.jsp/ forward name=goTwo path=/newtwo.jsp/ /action DadaAction: String tab = request.getParameter(newTab); if(operative.equals(tab)) { return (mapping.findForward(goOperative)); }else if(system.equals(tab)) { return (mapping.findForward(goSystem)); } I hope someone can help me with this setup or recommend a better approach. Preferably without additional libraries. ...Michael... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Advice requested, what's the best way to mimic tab panes in Struts?
For the controller/logic part, I also think you need one action and one form for all your tabs. For the view part, check Tiles : there is an example of tabs (struts-tiles/examples/summariesTabs.jsp). You can easily adapt it to your needs. You can create a body with the submit/cancel button, and insert tabs in this body. Cedric [EMAIL PROTECTED] wrote: One other question though now that I am looking at this a little closer: Each of my individual JSP's should not have a Submit/Cancel/Reset for each page.I was thinking about having one and only one Submit/Cancel button. So I would probobly use a Frame and have a target window (which would be filled in by one of the 5 different JSP files). The outer frame itself would contain the Submit button (but would not necessarily have to be a frame). The outer frame would also contain the links that would invoke the corresponding Form-Action load for that respective JSP. Would that be a viable approach rather than having a Submit button on each tab?I would only need to do my required fields check when they hit the global submit (in which case I can redirect them to the specific JSP that needs to be corrected should an error occur). Please let me know if I am on the right wave length here. thanks, Theron K Rob Breeds Rob_Breeds@uTo: Struts Users Mailing List k.ibm.com [EMAIL PROTECTED] cc: 03/04/02 Subject: Re: Advice requested, what's the best way to 09:22 AM mimic tab panes in Struts? Please respond to Struts Users Mailing List 1 ActionForm (session scope), 5 ActionMappings, one Action, 5 JSPs. Each tab has link which submits form with that tab's form values, the tab submit link is differentiated by mapping parameter attribute (or hidden form field). ActionForm validate checks data is OK. Each submit of the current tab is redirected back to the input page (the current tab). If the user changes tabs, the mapping simply redirects to the appropriate page. Only when the user clicks the final 'commit this lot' link should the Action actually process the data. Rob theron.kousek@ webmd.netTo: Struts Users Mailing List [EMAIL PROTECTED] cc: 04/03/2002 Subject: Advice requested, what's the best way to mimic tab panes in Struts? 17:11 Please respond to Struts Users Mailing List 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED
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]
AW: Advice requested, what's the best way to mimic tab panes in Struts?
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]
AW: Advice requested, what's the best way to mimic tab panes in Struts?
Sorry forgot to say, hold your form in the session, so you are able to give the user more steps to include this. -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]
Re: Advice requested, what's the best way to mimic tab panes in Struts?
1 ActionForm (session scope), 5 ActionMappings, one Action, 5 JSPs. Each tab has link which submits form with that tab's form values, the tab submit link is differentiated by mapping parameter attribute (or hidden form field). ActionForm validate checks data is OK. Each submit of the current tab is redirected back to the input page (the current tab). If the user changes tabs, the mapping simply redirects to the appropriate page. Only when the user clicks the final 'commit this lot' link should the Action actually process the data. Rob theron.kousek@ webmd.netTo: Struts Users Mailing List [EMAIL PROTECTED] cc: 04/03/2002 Subject: Advice requested, what's the best way to mimic tab panes in Struts? 17:11 Please respond to Struts Users Mailing List 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]
Re: Advice requested, what's the best way to mimic tab panes in Struts?
One other question though now that I am looking at this a little closer: Each of my individual JSP's should not have a Submit/Cancel/Reset for each page.I was thinking about having one and only one Submit/Cancel button. So I would probobly use a Frame and have a target window (which would be filled in by one of the 5 different JSP files). The outer frame itself would contain the Submit button (but would not necessarily have to be a frame). The outer frame would also contain the links that would invoke the corresponding Form-Action load for that respective JSP. Would that be a viable approach rather than having a Submit button on each tab?I would only need to do my required fields check when they hit the global submit (in which case I can redirect them to the specific JSP that needs to be corrected should an error occur). Please let me know if I am on the right wave length here. thanks, Theron K Rob Breeds Rob_Breeds@uTo: Struts Users Mailing List k.ibm.com [EMAIL PROTECTED] cc: 03/04/02 Subject: Re: Advice requested, what's the best way to 09:22 AM mimic tab panes in Struts? Please respond to Struts Users Mailing List 1 ActionForm (session scope), 5 ActionMappings, one Action, 5 JSPs. Each tab has link which submits form with that tab's form values, the tab submit link is differentiated by mapping parameter attribute (or hidden form field). ActionForm validate checks data is OK. Each submit of the current tab is redirected back to the input page (the current tab). If the user changes tabs, the mapping simply redirects to the appropriate page. Only when the user clicks the final 'commit this lot' link should the Action actually process the data. Rob theron.kousek@ webmd.netTo: Struts Users Mailing List [EMAIL PROTECTED] cc: 04/03/2002 Subject: Advice requested, what's the best way to mimic tab panes in Struts? 17:11 Please respond to Struts Users Mailing List 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