Bonjour a tous et toutes,
J'ai un petit soucis dont je n'arrive pas a trouver la solution
Alors j'ai un formulaire, et je cherche a afficher un selectbox, qui affiche une propertie de ma liste, chose qui avait toujours marché sans trop forcé jusque la, et la je ne sais pas trop d'ou ca viens.
Mon code action :
Ma code formulaire lié :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 /** * Met a jour la liste de variable globale. * @param request * @param aform * @throws DAOException * @throws GenericException */ public void majListeVariableGlobal(HttpServletRequest request, ActionForm aform) throws DAOException, GenericException { log.debug("Récupération de la liste des variables globales .."); List<Variable> listeVarGlobal = new ArrayList<Variable>(); try { listeVarGlobal = mofacad.getVariables(); } catch (GenericException e) { log.error("Erreur récupération liste variable - " + e.getMessage()); throw new GenericException("ErreurBase", e.getMessage()); } log.debug("On ajoute la liste de variable globale a la page"); ((AdministrationProduitForm) aform).setListeVariableGlobale(listeVarGlobal); ((AdministrationProduitForm) aform).setListeVariableGlobal(listeVarGlobal); log.debug("Liste variable récupérée et mise a jour ..");
Mon code jsp :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141 public class AdministrationProduitForm extends GenericForm { //----------------------------------------- private static final long serialVersionUID = 8736818772542508633L; private static Log log; private List<Variable> listeVariableGlobale; private List<Variable> listeVariableGlobal; private List<Variable> listeVariableProduit; private int idVariableGlobaleSelect; private String code; private String libelleSelect; private String codeSelect; //----------------------------------------- public AdministrationProduitForm() { super(); log = LogFactory.getLog(AbstractGenericDAO.class); setListeVariableProduit(new ArrayList<Variable>()); setListeVariableGlobale(new ArrayList<Variable>()); setListeVariableGlobal(new ArrayList<Variable>()); setIdVariableGlobaleSelect(1); setCode(""); setLibelleSelect(""); setCodeSelect(""); } /** * @param listeVariableProduit the listeVariableProduit to set */ public void setListeVariableProduit(List<Variable> listeVariableProduit) { this.listeVariableProduit = listeVariableProduit; } /** * @return the listeVariableProduit */ public List<Variable> getListeVariableProduit() { return listeVariableProduit; } /** * @param listeVariableGlobale the listeVariableGlobale to set */ public void setListeVariableGlobale(List<Variable> listeVariableGlobale) { this.listeVariableGlobale = listeVariableGlobale; } /** * @return the listeVariableGlobale */ public List<Variable> getListeVariableGlobale() { return listeVariableGlobale; } /** * @param idVariableGlobaleSelect the idVariableGlobaleSelect to set */ public void setIdVariableGlobaleSelect(int idVariableGlobaleSelect) { this.idVariableGlobaleSelect = idVariableGlobaleSelect; } /** * @return the idVariableGlobaleSelect */ public int getIdVariableGlobaleSelect() { return idVariableGlobaleSelect; } /** * @param code the code to set */ public void setCode(String code) { this.code = code; } /** * @return the code */ public String getCode() { return code; } /** * @param libelleSelect the libelleSelect to set */ public void setLibelleSelect(String libelleSelect) { this.libelleSelect = libelleSelect; } /** * @return the libelleSelect */ public String getLibelleSelect() { return libelleSelect; } /** * @param codeSelect the codeSelect to set */ public void setCodeSelect(String codeSelect) { this.codeSelect = codeSelect; } /** * @return the codeSelect */ public String getCodeSelect() { return codeSelect; } /** * @param listeVariableGlobal the listeVariableGlobal to set */ public void setListeVariableGlobal(List<Variable> listeVariableGlobal) { this.listeVariableGlobal = listeVariableGlobal; } /** * @return the listeVariableGlobal */ public List<Variable> getListeVariableGlobal() { return listeVariableGlobal; } }
Voila en fait le logic:notEmpty fonctionne bien car si je met du texte il me l'affiche bien, mais dès que j'y met ma selectbox tout le tile plante et ainsi la page s'affiche sans son corp et surtout sans erreurs.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <logic:notEmpty name="administrationProduitForm" property="listeVariableGlobal"> <td> <html:select name="administrationProduitForm" property="idVariableGlobaleSelect" onchange="" > <html:optionsCollection property="code"/> </html:select> </td> </logic:notEmpty> <logic:empty name="administrationProduitForm" property="listeVariableGlobal"> <td> <p>pas de liste !!!!</p> </td> </logic:empty>
Des idées ?
Partager