tijmaster
09-09-2009, 12:42 PM
Hello everybody !
I would like to submit form containing a list of complex objects but I get a IndexOutOfBoundsException :(
I searched on the web and mainly the solution is to save the form in the session so that the reset method is not invoked. This is what I did (in the jsp call and in the struts-config definition) but it stills call the reset method of my form...
This my form definition :
public class ExtourneMvtForm extends OperationForm{
/* Liste des lignes de Mouvements de l'extourne */
private List mouvements = null;
getter/setter
// this is the definition of the complext objects to be stored in the list
/**
* Classe interne gerant l'Object Metier attaché a la ligne du Schema Comptable *
*/
public class LigneMvt extends MetierBean {
private String typMvt = null;
private String libTypMvt = null;
private double mntOri = 0;
private String devOri = null;
private double mntExtourne = 0;
private String devExtourne = null;
private String topExtourne = null;
getter/setter
}
}
Here is the jsp :
<logic:iterate id="mouvements" name="operationForm" property="mouvements" >
<TR >
<TD>
<html:text indexed="true" name="mouvements" property="metier.typMvt" size="10" readonly="true" styleClass="Texte2"/>
</TD>
<TD>
<html:text indexed="true" name="mouvements" property="metier.libTypMvt" size="40" readonly="true" styleClass="Texte2"/>
</TD>
<TD id="ListeTab" width="120">
<html:text indexed="true" name="mouvements" property="metier.mntOri" size="20" readonly="true" styleClass="ZoneNum" />
</TD>
<TD id="ListeTab" width="120">
<html:text indexed="true" name="mouvements" property="metier.mntExtourne" size="20" />
</TD>
</TR>
</logic:iterate>
I would like to submit form containing a list of complex objects but I get a IndexOutOfBoundsException :(
I searched on the web and mainly the solution is to save the form in the session so that the reset method is not invoked. This is what I did (in the jsp call and in the struts-config definition) but it stills call the reset method of my form...
This my form definition :
public class ExtourneMvtForm extends OperationForm{
/* Liste des lignes de Mouvements de l'extourne */
private List mouvements = null;
getter/setter
// this is the definition of the complext objects to be stored in the list
/**
* Classe interne gerant l'Object Metier attaché a la ligne du Schema Comptable *
*/
public class LigneMvt extends MetierBean {
private String typMvt = null;
private String libTypMvt = null;
private double mntOri = 0;
private String devOri = null;
private double mntExtourne = 0;
private String devExtourne = null;
private String topExtourne = null;
getter/setter
}
}
Here is the jsp :
<logic:iterate id="mouvements" name="operationForm" property="mouvements" >
<TR >
<TD>
<html:text indexed="true" name="mouvements" property="metier.typMvt" size="10" readonly="true" styleClass="Texte2"/>
</TD>
<TD>
<html:text indexed="true" name="mouvements" property="metier.libTypMvt" size="40" readonly="true" styleClass="Texte2"/>
</TD>
<TD id="ListeTab" width="120">
<html:text indexed="true" name="mouvements" property="metier.mntOri" size="20" readonly="true" styleClass="ZoneNum" />
</TD>
<TD id="ListeTab" width="120">
<html:text indexed="true" name="mouvements" property="metier.mntExtourne" size="20" />
</TD>
</TR>
</logic:iterate>