Bonjour,
J'ai développé un formulaire JSF. Malheueusement, lorsque je clique sur soumettre, il ne suit pas ma regle de navigation et se contente d'un simple refresh !
J'ai ajouté un écouteur de phase :
Celui ci m'indique lors du chargement :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 public void afterPhase(PhaseEvent pe){ System.out.println("Apres " + pe.getPhaseId()); } public void beforePhase(PhaseEvent pe){ System.out.println("Avant " + pe.getPhaseId()); } public PhaseId getPhaseId(){ return PhaseId.ANY_PHASE; }
Avant RESTORE_VIEW 1
Apres RESTORE_VIEW 1
Avant RENDER_RESPONSE 6
Apres RENDER_RESPONSE 6
Et... exactement la même chose lors de la soumission
La méthode associée à mon bouton de soumission n'est en fait jamais appelée; elle a beau contenir un simple sysout et un retour de chaine vide, rien ne se passe.
Mes recherches sur le net explique un tel phénomènes par :
- les balises verbatim : je n'en ai pas.
- des erreurs de conversions lors de validation : mon h:messages n'affiche rien, idem pour les h:messages associés à chacun des champs ; j'ai même essayé de remplir mes listes de choix dur plutot que de passer par mes beans mais rien ne change.
-> Par contre les balises de messages n'affichent peut-etre rien justement parce que l'action du bouton est un refresh et non pas une soumission...
- de mauvaises expressions EL : je les ai limitées à une seule pour mes tests (l'action liée au bouton) ; je pense pas qu'elle pointe vers une mauvaise valeur puisque c'est généré par l'AGL (WebShpere 7 d'IBM) ; j'ai même essayé d'écrire ça à la main mais rien n'y fait...
- j'ai tenté de passer mon bouton en immediate="true", pour sauter les phases de validation etc, mais rien n'a changé...
Voilà mon code JSF :
Des idées ? Je suis à bout là..
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%-- jsf:pagecode language="java" location="/src/fr/suo/formep/pagecode/Index.java" --%><%-- /jsf:pagecode --%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%> <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <html> <!-- En-tête --> <head> <title>Demande de changement(s) applicatif(s)</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta name="GENERATOR" content="Websphere Development Studio Client for iSeries"> <link rel="stylesheet" type="text/css" href="theme/stylesheet.css" title="Style"> <!-- Section des scripts --> <script type="text/javascript" src="js/actionsTableau.js"></script> <script type="text/javascript" src="js/date.js"></script> <script type="text/javascript" src="js/validations.js"></script> <script type="text/javascript" src="js/donnees.js"></script> <script type="text/javascript"> function func_3(thisObj) { verifierAvantAjout(thisObj); } function initDate() { loadDate(window.document.getElementById("formulaire:txtDateDemande")); } function func_4(thisObj) { //Si on modifie une ligne d'installation qui n'a pas encore été ajoutée if((thisObj.parentNode.parentNode.cells[7].firstChild.id.search(/insert/))!=(-1)) { //On adapte le reste de la ligne selon le type d'installation adapterContenu(thisObj); //Sinon, si on modifie une ligne d'installation déjà ajoutée } else { //On adapte le reste de la ligne adapterContenu(thisObj); //Et on modifie le libellé du document associé dans la table des docs modifierLibelleDoc((thisObj.options[thisObj.selectedIndex].text),(thisObj.parentNode.parentNode.rowIndex)); } } function func_5() { verifierAvantEnvoi(); } </script> <!-- Fin section scripts --> </head> <!-- Fin en-tête --> <f:view> <!-- Corps --> <body onload="initDate();"> <hx:scriptCollector id="scriptCollector1"> <h:form id="formulaire" styleClass="form" style="width: 100%"><p align="center"><font face="Microsoft Sans Serif" size="+2">Demande de changement(s) applicatif(s)</font></p> <fieldset style="width: 55%"><legend align="left"><span style='font-family: "Microsoft Sans Serif"; font-size: 10pt'>Informations générales</span></legend> <table border="0" width="100%"> <tbody> <tr> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt'>Environnement</td> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt'> <h:selectOneMenu id="cboEnvironnement" styleClass="selectOneMenu"> <f:selectItems value="#{beanListeEnvironnements.cboLstElements}" /> </h:selectOneMenu> </td> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt'>Domaine</td> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt'> <h:selectOneMenu id="cboDomaine" styleClass="selectOneMenu" style="width: 80px"> <f:selectItems value="#{beanListeDomaines.cboLstElements}" /> </h:selectOneMenu> </td> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt' width="94">Type application</td> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt' width="93"> <h:selectOneMenu id="cboTypeAppli" styleClass="selectOneMenu" style="width: 100px"> <f:selectItems value="#{beanListeTypesApplis.cboLstElements}" /> </h:selectOneMenu> </td> </tr> <tr> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt'>Date</td> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt'> <h:inputText id="txtDateDemande" styleClass="inputText" size="11" readonly="true"> <hx:convertDateTime dateStyle="short"/> <hx:inputHelperAssist id="assist1" errorClass="inputText_Error" validation="true" errorAction="selected"/> </h:inputText> </td> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt'>Pôle</td> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt'> <h:selectOneMenu id="cboPole" styleClass="selectOneMenu" style="width: 80px"> <f:selectItems value="#{beanListePoles.cboLstElements}" /> </h:selectOneMenu> </td> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt' width="94">Type demande</td> <td style='font-family: "Microsoft Sans Serif"; font-weight: 200; font-size: 9pt' width="93"> <h:selectOneMenu id="cboTypeDemande" styleClass="selectOneMenu" style="width: 100px"> <f:selectItems value="#{beanListeTypesDemandes.cboLstElements}" /> </h:selectOneMenu> </td> </tr> </tbody> </table> </fieldset> <fieldset style="width: 43%"> <legend align="left"> <span style='font-family: "Microsoft Sans Serif"; font-size: 9pt'>Informations sur les personnels</span> </legend> <table border="0" width="100%"> <tbody> <tr> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt'>Demandeur</td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt'> <h:selectOneMenu id="cboDemandeur" styleClass="selectOneMenu" style="width: 140px"> <f:selectItems value="#{beanListeDemandeurs.cboLstElements}" /> </h:selectOneMenu> </td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt'>Chef de projet</td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt'> <h:selectOneMenu id="cboChefProjet" styleClass="selectOneMenu" style="width: 140px"> <f:selectItems value="#{beanListeChefsProjets.cboLstElements}" /> </h:selectOneMenu> </td> </tr> <tr> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt'>Chargé d'intégration</td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt'> <h:selectOneMenu id="cboChIntegration" styleClass="selectOneMenu" style="width: 140px"> <f:selectItems value="#{beanListeChargesIntegration.cboLstElements}" /> </h:selectOneMenu> </td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt'>Code projet</td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt'> <h:inputText id="txtCodeProjet" styleClass="inputText" size="19" required="true"> <hx:inputHelperAssist validation="true" errorClass="inputText_Error" /> </h:inputText> </td> </tr> </tbody> </table> </fieldset> <br> <h:messages layout="table" globalOnly="false"/> <fieldset style="width: 98%"> <legend> <span style='font-family: "Microsoft Sans Serif"; font-size: 10pt'>Détails sur la demande</span> </legend> <table width="100%" border="0"> <tbody> <tr> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt' width="10%">Date de démarrage utilisateur prévue</td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt' width="15%"> <h:inputText id="txtDateUtilisateurPrevue" styleClass="inputText" style="width: 80%" required="true"> <hx:convertDateTime type="date" dateStyle="long" pattern="dd/MM/yyyy" /> <hx:validateDateTimeRange minimum="#{now}" /> <hx:inputHelperDatePicker id="datePicker1" /> <hx:inputHelperAssist validation="true" errorClass="inputText_Error" errorAction="selected" /> </h:inputText> </td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt' width="10%">Activité d'imputation dans Views</td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt' align="left" width="10%"> <h:inputText id="txtImputation" styleClass="inputText" style="width: 100%"> </h:inputText> </td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt' width="180"></td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt' width="168"></td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt' width="86"></td> </tr> </tbody> </table> <br> <table border="0" width="45%"> <tbody> <tr> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt' width="22%">Intitulé du projet</td> <td style='font-family: "Microsoft Sans Serif"; font-size: 9pt' width="80%"> <h:inputText id="txtTitreDemande" styleClass="inputText" required="true" style="width: 100%"> <hx:inputHelperAssist validation="true" errorClass="inputText_Error" errorAction="selected" /> </h:inputText> </td> </tr> </tbody> </table> <h:inputTextarea id="txaDescrDemande" styleClass="inputTextarea" style='font-family: "Microsoft Sans Serif"; width: 100%; font-size: 9pt' rows="5" value="Entrez ici une description synthétique de la demande."> <hx:behavior event="onclick" id="behavior1" behaviorAction="selected"></hx:behavior> </h:inputTextarea> </fieldset> <br> <br> <br> <table id="tabInstalls" width="98%" border="0" style='font-family: "Microsoft Sans Serif"; font-size: 9pt' cellspacing="1"> <!-- Header de la table --> <thead> <tr> <th colspan="8" style="background-color: #bad4fc">Eléments à installer</th> </tr> <tr> <td style="background-color: #bad4fc" align="center" width="11%">Type d'installation</td> <td style="background-color: #bad4fc" align="center" width="19%">Application</td> <td style="background-color: #bad4fc" align="center" width="12%">Version</td> <td style="background-color: #bad4fc" align="center" width="18%">Destination</td> <td style="background-color: #bad4fc" align="center" width="10%">Date souhaitée</td> <td style="background-color: #bad4fc" align="center" width="8%">Heure souhaitée</td> <td style="background-color: #bad4fc" align="center" width="157">Champ spécifique</td> <td style="background-color: #bad4fc" width="3%" align="center"></td> </tr> </thead> <!-- Pied de la table --> <tfoot> <tr> <td> <h:selectOneMenu id="cboTypeInstall_0" styleClass="selectOneMenu" style="width: 100%" onchange="func_4(this);"> <f:selectItems value="#{beanListeTypesInstalls.cboLstElements}" /> </h:selectOneMenu> </td> <td>Non requis</td> <td>Non requis</td> <td> <h:inputText id="txtDestination_0" styleClass="inputText" style="width: 100%"> <hx:inputHelperAssist errorClass="inputText_Error" errorAction="selected" /> </h:inputText> </td> <td> <h:inputText id="txtDateSouhaitee_0" styleClass="inputText" style="width: 100%"> <hx:convertDateTime pattern="dd/MM/yyyy" /> <hx:validateDateTimeRange minimum="#{now}" /> <hx:inputHelperDatePicker id="datePicker2" /> <hx:inputHelperAssist errorClass="inputText_Error" errorAction="selected" /> </h:inputText> </td> <td> <h:inputText id="txtHeureSouhaitee_0" styleClass="inputText" style="width: 100%"> <hx:convertDateTime type="time" timeStyle="short" /> <hx:inputHelperDatePicker id="datePicker4" delta="900" /> <hx:inputHelperAssist errorClass="inputText_Error" errorAction="selected" /> </h:inputText> </td> <td>Non requis</td> <td> <hx:commandExButton type="button" value="Ajouter" id="btnArray_insert_0" styleClass="commandExButton" onclick="return func_3(this);"> </hx:commandExButton> </td> </tr> </tfoot> <!-- Corps de la table --> <tbody> </tbody> </table> <br> <br> <table width="98%" border="0" style='font-family: "Microsoft Sans Serif"; font-size: 9pt' cellspacing="1" id="tabDocs"> <thead> <tr> <th colspan="2" style="background-color: #bad4fc">Documentation à joindre</th> </tr> <tr> <th style="background-color: #bad4fc" width="50%">Libellé</th> <th style="background-color: #bad4fc" width="50%">Emplacement</th> </tr> </thead> <tfoot style="visibility: hidden"> <tr> <th width="495">Manuel d'installation</th> <th width="496"> <hx:fileupload id="fleUpload_0" styleClass="fileupload" style="width: 100%; margin: 0px"> </hx:fileupload> </th> </tr> </tfoot> <tbody> </tbody> </table> <br> <br> <h:outputLabel value="Observations et réserves éventuelles" id="label1" styleClass="outputLabel" style='font-family: "Microsoft Sans Serif"; font-size: 9pt'> </h:outputLabel> <br> <h:inputTextarea id="txaObservations" styleClass="inputTextarea" value="Entrez ici les observations, conseils, réserves ou recommandations relatifs à la demande." style='font-family: "Microsoft Sans Serif"; width: 98%; font-size: 9pt' rows="5"> <hx:behavior event="onclick" id="behavior2" behaviorAction="selected"> </hx:behavior> </h:inputTextarea> <br> <br> <center> <hx:commandExButton type="submit" value="Soumettre" id="btnEnvoi" styleClass="commandExButton" action="#{pc_Index.doBtnEnvoiAction}" onfocus="return func_5();" confirm="Envoyer la demande ?"> </hx:commandExButton></center> </h:form> </hx:scriptCollector> </body> </f:view> </html>
Partager