Dobry Wieczór Konrad-

Here is an example of a multiple DynaActionForm using field names based on Part 
Number (PartNumber1, PartNumber2) 
http://www.developer.com/java/ejb/article.php/2233591

take a look at the JSP html:text property <TD><html:text 
property="partNumber1"/></TD>

which have corresponding mapped names from the DynaActionForm e.g.
in struts-config.xml
<form-property name="partNumber1" type="java.lang.String"/>

these are easily modifiable to map commensurate text property name for your 
PrepareEditXYZAction (DynaAction.. bean) scenario

Anyone else?
Dziekuje,
Martin-
----- Original Message ----- 
From: "Konrad Billewicz" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Tuesday, December 27, 2005 3:00 PM
Subject: Right way to handle compilcated form


> Hello,
> 
> I have a complicated form with mulit-level menu (several <select>'s with 
> onchange='submit()' ). I'm not sure how I should organize my Actions.
> 
> Currently I have PrepareEditXYZAction which handles the JSP page. Form in 
> the JSP page routes back to PrepareEditXYZAction. Inside 
> PrepareEditXYZAction action I'm making a decision (based on check if submit 
> button was clicked) what to show -  JSP page (if submit wasn't clicked) or 
> EditXYZAction (if it was). EditXYZAction is validating data and invokes 
> managers to do the job.
> 
> I'm using Struts validation based on ValidationForm's. PrepareEditXYZAction 
> has validate set to false while EditXYZAction has it set to true and input 
> set to PrepareEditXYZAction (/prepareEditXYZAction.do).
> 
> It sounds nice but I have a problem when validation error occurs. In this 
> case I have an infinite loop bacause:
> 1. PrepareEditXYZAction redirects to EditXYZAction (bacause submit was 
> clicked)
> 2. Validation before EditXYZAction fails and redirects to 
> PrepareEditXYZAction.
> 3. Go to 1.
> 
> I have several ideas how to handle this problem but I'm not sure if I'm 
> doing it right. Do you know pattern for handling such cases? I look thought 
> Struts manual, Struts in Action and the Web but found nothing interesting.
> 
> Best regards,
> Konrad Billewicz
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to