Voici le code complet de ma 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 <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <f:view> <html> <head> <title>Save a new book</title> </head> <body> <rich:tabPanel> <rich:tab label="Save Book"> <h:form id="myForm"> <rich:modalPanel id="mp" width="350" height="100" showWhenRendered="#{facesContext.maximumSeverity!=null}"> <f:facet name="header"> <h:panelGroup> <h:outputText value="Modal Panel"></h:outputText> </h:panelGroup> </f:facet> <f:facet name="controls"> <h:panelGroup> <h:graphicImage value="/images/modal/close.png" style="cursor:pointer" id="hidelink" /> <rich:componentControl for="mp" attachTo="hidelink" operation="hide" event="onclick" /> </h:panelGroup> </f:facet> <rich:messages /> </rich:modalPanel> <rich:panel style="width=50%"> <f:facet name="header"> <h:outputText value="Save a new book"></h:outputText> </f:facet> <h:panelGrid columns="2"> <h:outputText value="ISBN:" /> <h:inputText id="isbn" required="true" value="#{manageBook.book.isbn}"> </h:inputText> <h:outputText value="Title:" /> <h:inputText id="title" value="#{manageBook.book.titre}"> </h:inputText> <h:outputText value="Author:" /> <h:inputText id="auteur" value="#{manageBook.book.auteur}"> </h:inputText> <h:outputText value="Price:" /> <h:inputText id="prix" value="#{manageBook.book.prix}"> </h:inputText> <a4j:commandButton value="Validate" action="#{manageBook.saveBook}" oncomplete="Richfaces.showModalPanel('myForm:mp');" /> </h:panelGrid> <rich:comboBox defaultLabel="Enter some value"> <f:selectItem itemValue="suggestion 1" /> <f:selectItem itemValue="suggestion 2" /> <f:selectItem itemValue="suggestion 3" /> <f:selectItem itemValue="suggestion 4" /> <f:selectItem itemValue="suggestion 5" /> </rich:comboBox> </rich:panel> </h:form> </rich:tab> <rich:tab label="Save User"> </rich:tab> <rich:tab label="Third" disabled="true"> </rich:tab> </rich:tabPanel> </body> </html> </f:view>
Y'a surement une bétise quelque part, une form mal placée ou que sais-je que je vois pas.
J'ai essayé une fonction qui me retourne si il y a des erreurs dans le FacesContext. Lorsque j'arrive dans ma méthode saveBook() (et que donc pas d'erreur avec le required=true) il m'indique qu'il n'y a aucune autre erreur dans le context.
Partager