Salut Mobius, la forme? :)
Je n'arrive toujours pas à récupérer les valeurs de mon checkbox pourtant mon Form parait être correct...
L'action:
Le Form:Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 public ActionForward delete( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ShowCartForm CartForm = (ShowCartForm) form; String hop [] = CartForm.getId_Souche(); int sizeounette = hop.length; for (int po=0; po<sizeounette; po++) { System.out.println("Produit N° "+po+"---"+ hop[po]); } // TODO Auto-generated method stub System.out.println("Click on >> DELETE"); return mapping.findForward("oui"); }
Et mon JSP: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 public class ShowCartForm extends ActionForm { // --------------------------------------------------------- Instance Variables /** profil property */ private String []Id_Souche = new String[10]; // --------------------------------------------------------- Methods /** * Returns the Id_Souche. * @return String */ public String [] getId_Souche() { return Id_Souche; } /** * Set the Id_Souche. * @param Hidden The Id_Souche set */ public void setId_Souche(String [] Id_Souche) { this.Id_Souche = Id_Souche; } }
Ai-je fait une erreur grossière? :oops: Honnetemment je ne vois pas là...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 <html:form action="/showCart"> <table border="0" align="left"> <logic:iterate id="element" name="tableau"> <tr> <TD><html:checkbox name="element" property="Id_Souche"></html:checkbox> </TD> <TD><b><font color="blue"><bean:write name="element" property="Id_Souche"/></font></b></TD> <TD> </TD> <td><b> Date: </b></td> <TD><font color="blue"><bean:write name="element" property="date"/><br></font></TD> <TD> </TD> <td><B> Amount: </B> </td> <td> <font color="blue"><bean:write name="element" property="quantite"/></font></td> </tr> </logic:iterate> </table><br> <P style="padding-left:212px;padding-right:12px;"> <br> </P> <table border="0" align="left"> <tr> <html:hidden property="hidden" value="delete"/> <html:submit onclick="setHidden('delete');">Delete</html:submit></td> </tr> </table> </html:form>
Encore merci