Hi, I am new to the Struts2 and facing the similar issue , u said u have managed to get the data from the dynmically generated fields to the action , can u share how it can be done.......a sample will be of great help....... my requirment is my form is dynamically generat the fileds for name date and amount and it could raneg from one to man fields how would i get the details of the form data in my actions .... bcoz i am not sure how many fields will be filled out .....
Thanks you java.harpr...@gmail.com Julio Alberto Jalón wrote: > > > May I didn't explain myself correctly. What I would like to know is how to > validate multiple fields. I'll write an example. I have a form in a JSP > which generate the field dynamically. E.g: > > <s:form action="editPerson" theme="simple" validate="false"> > <table> > <tr> > <th>ID</th> > <th>First Name</th> > <th>Last Name</th> > </tr> > <s:iterator id="p" value="persons"> > <tr> > <td> > <s:property value="%{id}" /> > </td> > <td> > <s:textfield label="First Name" > name="persons(%{id}).name" value="%{name}" theme="simple" /> > </td> > <td> > <s:textfield label="Last Name" > name="persons(%{id}).lastName" value="%{lastName}" theme="simple"/> > </td> > </tr> > </s:iterator> > </table> > > <s:submit method="save" value="Save all persons"/> > </s:form> > > > > Where person is a List in the action class. Now, what I would like to know > is how could I achieve this fields to be validated. For example, I would > like that if the name is filled the last name should be also filled and > both can only contains letters and blanks. > > Well, I don't want you to give me the complete solution ( the expresion or > reg expresion), just want to know how I can refer all these fields from > the MyActionClass-validation.xml. > > Hope I've explained better than in the first post. > > Please, help me. > > Thanks in advance. > > > ----- Mensaje original ---- > De: Julio Alberto Jalón <bert...@yahoo.es> > Para: user@struts.apache.org > Enviado: miércoles, 15 de octubre, 2008 12:32:05 > Asunto: Struts2 Collection validation > > > I'm learning struts2 through the struts2-showcase application example. > From the "Person Manager" functionality I've learned how to send multiples > values from client to server using collections to manage these values, but > now I'd like to know how to validate these values using struts2 > validation. I don't know what to put in *-validation.xml in order to > validate these values. Should I use custom validation? > > Thanks in advance. > > > > -- View this message in context: http://old.nabble.com/Struts2-Collection-validation-tp19991675p28674052.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org