[Struts] validation formulaire
Bonjour tout le monde,
j'ai un soucis lorsque je souhaite valider un formulaire.
tout se passe bien sauf pour un élement du formulaire qui n'est pas valider.
mon formulaire se compose de pas mal de champs et d'un tableau de productGroup (c'est l'élément qui foire).
poit de vue code ca donne ceci.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
// FORM product group
private ProductGroup[] prod=new ProductGroupTO[]{};
public ProductGroup[] getProd() {
return prod;
}
public void setProd(ProductGroup[] prod) {
this.prod = prod;
}
//action
ProductGroup[] p = new ProductGroupTO[pg.size()];
int i=0;
//Iterator it=pg.iterator();
for (Iterator it = pg.iterator(); it.hasNext();)
{
ProductGroup pr = (ProductGroupTO) it.next();
p[i]=new ProductGroupTO();
p[i].setDescription(pr.getDescription());
p[i].setSecured_client(pr.getSecured_client());
p[i].setSecured_client_counter(pr.getSecured_client_counter());
i++;
}
form.setProd(p);
BeanUtils.copyProperties(form, p);
session.setAttribute("CustomerManagementActionForm",form);
//jsp
<html:form name="CustomerManagementActionForm" type="be.post.maintenance.view.form.CustomerManagementActionForm" action="/jsp/customerManagementAction.do?action=editCustomer" scope="session">
logic:iterate indexId="i" id="current" property="prod" name="CustomerManagementActionForm" >
<tr>
<td><bean:write name="current" property="description"/></td>
<td><html:checkbox name="current" property="secured_client"/></td>
<td><html:text name="current" property="secured_client_counter" /></td>
<tr>
</logic:iterate>
</table>
<button:submit width="100" label="<%=TranslationUtils.GetPromptTranslation("MPW_EDIT_CUSTOMER","EDIT",pageContext.getSession().getId())%>"/>
</html:form>
// product group
private Long number;
private String description;
private Integer webAvailable;
private Integer forceStatus;
private boolean secured_client;
private String secured_client_counter; |
merci d'avance pour les idées que vous me soumetrez.