[STRUTS] logic:iterate / html:input
Bonjour,
J essai d implement une saisie en liste dans une jsp:
J ai une ActionForm qui comporte un tableau d'object (TestBean) que j'affiche avec un <logic:iterate>.
L'affichage de se tableau fonctionne très bien .
Mais la mise à jour des champs dans cette liste ne fonctionne pas: lorsque je submit le formulaire les valeurs que j ai saisie dans <html:input> sont perdus.
Avez vous une idee ? le <html:input> est-elle incompatible avec <logic-iterate> ?
un extrait de ma jsp:
Code:
1 2 3 4 5 6 7 8 9 10 11
|
<logic:iterate id="lst" name="theForm" property="item" indexId="id">
<html:multibox property="selectedItem" >
<bean:write name="lst" property="lib" />
</html:multibox>
<bean:write name="lst" property="lib"/>
<html:text name="lst" property="nom" indexed="true" />
<br>
</logic:iterate> |
Mon Bean
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
|
public class TestBean
{
String _lib;
String _nom;
boolean _val;
public TestBean(String l,String n, boolean v)
{
_nom = n;
_lib = l;
_val = v;
}
public String getLib()
{
return _lib;
}
public boolean getVal()
{
return _val;
}
public void setLib(String l)
{
_lib = l;
}
public void setVal(boolean v)
{
_val = v;
}
public String getNom()
{
return _nom;
}
public void setNom(String n)
{
_nom = n;
} |
mon inputForm:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
public class GenericForm extends CsForm
{
private String [] selectedItem;
private TestBean[] lvbeans;
public TestBean [] getItem()
{
return lvbeans;
}
public void setItem(TestBean[]i)
{
lvbeans = i;
}
public String[] getSelectedItem()
{
return selectedItem;
} |
[/quote]