Problème ActionForm et checkbox
j'ai une jsp qui affiche toutes mes boisson une boisson a pour attribut :
nom
type
description
id
voilà ma jsp qui affiche toutes les boissons
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
<html:form action="/delete">
<logic:iterate id="boisson" name="listboisson">
<tr>
<td> <html:checkbox property="lst.id" /></td>
<td> <bean:write name="boisson" property="nom"/></td>
<td> <bean:write name="boisson" property="type"/></td>
<td> <bean:write name="boisson" property="description"/></td>
<td> <bean:write name="boisson" property="prix"/> </td>
<td> <a href=/Drink_me_I_m_famous_/modif.do?id=<bean:write name="boisson" property="id"/>><img src="http://localhost:8084/Drink_me_I_m_famous_/Image/modifier.gif"/></a></td>
</tr>
</logic:iterate>
<html:submit value="Supprimer"/>
</html:form> |
J'aimerais mettre une checkbox pour chaque boisson , et les supprimer lorsque je clique sur supprimer .
Voilà le strut-conf :
Code:
1 2 3 4 5 6 7 8 9 10 11
|
<form-beans>
<form-bean name="deleteform" type="com.bar.deleteFORM"/>
</form-beans>
<!-- Mapping Formulaire Suppression de boissons -->
<action path="/delete"
type="com.bar.viewboissonAction"
name="deleteform">
<forward name="viewlist" path="/WEB-INF/Website/viewboisson.jsp"/>
</action> |
et enfin voilà ma deleteForm.java:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.bar;
import java.util.ArrayList;
import java.util.List;
import org.apache.struts.action.ActionForm;
public class deleteFORM extends ActionForm {
private List<Integer> lst;
public deleteFORM() {
lst = new ArrayList<Integer>();
}
} |
Le problème c'est que je ne sais pas ce que vont renvoyer les checkbox ?? j'aimerait qu'elle renvoye l'id de mes boisson mais je n'arrive pas a imbriqués les balise <html: pour faire un truc du style :
Code:
<td> <html:checkbox property="lst.id" value="<bean:write name="boisson" property="id"/>" /></td>
Mais il m'est impossible d'imbriquer ces balise :(
J'ai donc une question :
- Qu'elle form doit avoir mon ActionForm pour récuperer les differentes value de mes checkbox ?