Bonjour tous le monde
je suis entrain de réaliser une application web avec JSF2.0 et Primefaces3.2.
je rencontre un problème avec les SelectOneMenu lors de l'envoi de ma page ila me renvoie l'erreur suivant :
j_idt6:type : erreur de validation. La valeur est incorrecte.
j_idt6:logement : erreur de validation. La valeur est incorrecte.
j_idt6:local : erreur de validation. La valeur est incorrecte.
voici la page avis_fr.xhtml :
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 <h:selectOneMenu id="type" value="#{MBavis.avis.type}"> <f:selectItems value="#{listes.list_type}" var="typpe" itemLabel="#{type}" itemValue="#{typpe}" /> </h:selectOneMenu> </div> <div id="divComponent_fr"> <p:inputTextarea id="objet" value="#{MBavis.avis.objet}" rows="2" maxlength="50" autoResize="false"/> </div> <div id="divComponent_fr"> <h:selectOneMenu id="logement" value="#{MBavis.avis.logement}" > <f:selectItems value="#{MBavis.liste.list_logement_fr}" /> </h:selectOneMenu> </div> <div id="divComponent_fr"> <h:selectOneMenu id="local" value="#{MBavis.avis.localisation}"> <f:selectItems value="#{MBavis.liste.list_localiastion_fr}"/> </h:selectOneMenu> </div>
voici la classe Litses :
voici mon ManagedBean MB_Avis:
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 public class Listes implements Serializable{ private List<String> list_logement_fr = new ArrayList<String>(); private List<String> list_localiastion_fr = new ArrayList<String>(); private List<String> list_type = new ArrayList<String>(); public Listes() { this.list_logement_fr.add("appartement économique"); this.list_logement_fr.add("Villa économique"); this.list_localiastion_fr.add("locale1"); this.list_localiastion_fr.add("locale2"); this.list_type.add("dépot de candidature"); this.list_type.add("autre service"); } public List<String> getList_localiastion_ar() { return list_localiastion_ar; } public void setList_localiastion_ar(List<String> list_localiastion_ar) { this.list_localiastion_ar = list_localiastion_ar; } public List<String> getList_localiastion_fr() { return list_localiastion_fr; } public void setList_localiastion_fr(List<String> list_localiastion_fr) { this.list_localiastion_fr = list_localiastion_fr; } public List<String> getList_logement_ar() { return list_logement_ar; } public void setList_logement_ar(List<String> list_logement_ar) { this.list_logement_ar = list_logement_ar; } public List<String> getList_logement_fr() { return list_logement_fr; } public void setList_logement_fr(List<String> list_logement_fr) { this.list_logement_fr = list_logement_fr; } public List<String> getList_type() { return list_type; } public void setList_type(List<String> list_type) { this.list_type = list_type; } }
mon Bean Avis:
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 @ManagedBean(name = "MBavis") @SessionScoped public class MB_Avis implements Serializable{ private Avis avis; private Listes liste = new Listes(); public MB_Avis() { this.avis = new Avis(); } public Avis getAvis() { return avis; } public void setAvis(Avis avis) { this.avis = avis; } public Listes getListe() { return liste; } public void setListe(Listes liste) { this.liste = liste; } }
Remarque : lorsque j’insère des dans mes listes des String sans caractère "é ou è" ça marche !
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 public class Avis implements Serializable{ private String type; private String objet; private String logement; private String localisation; private String texte1; private String texte2; private String texte3; private String url; public Avis() { this.type = ""; this.objet = ""; this.logement = ""; this.localisation = ""; this.texte1 = ""; this.texte2 = ""; this.texte3 = ""; this.url = ""; } public String getLocalisation() { return localisation; } public void setLocalisation(String localisation) { this.localisation = localisation; } public String getLogement() { return logement; } public void setLogement(String logement) { this.logement = logement; } public String getObjet() { return objet; } public void setObjet(String objet) { this.objet = objet; } public String getTexte1() { return texte1; } public void setTexte1(String texte1) { this.texte1 = texte1; } public String getTexte2() { return texte2; } public void setTexte2(String texte2) { this.texte2 = texte2; } public String getTexte3() { return texte3; } public void setTexte3(String texte3) { this.texte3 = texte3; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } }
J'ai des recherche depuis trois semaine sans résultat Merci d'avance pour votre aide.
Partager