salut
SVP dans ma page j'ai un form que lorsque je clique sur un lien ma page fait appel à la méthode update pour mittre à jour mon form
voici mon form:
<h:form>
<p:tabView>
<p:tab title="Espace Restaurant">
<p:panel id="panel">
<p:messages />
<h:panelGrid columns="4" cellpadding="2" styleClass="général" style="COLOR: #d83f74; BACKGROUND-COLOR: #ffffff; width : 864px;">
<f:facet name="header"></f:facet>
<h:outputText value="Logo du restaurant" style="FONT-SIZE: small; padding:50px; COLOR: #c0c0c0;" /><p:graphicImage value="#{AuthentificationBean.partenaireLogged.photo}" width="200px" height="100px"></p:graphicImage>
<h:outputText value="" /><h:outputText value="" />
<h:outputText value="Nom du restaurant" style="FONT-SIZE: small; padding:50px; COLOR: #c0c0c0;" for="NomRestaurant"/>
<h:inputText id="NomRestaurant" required="true" value="#{AuthentificationBean.partenaireLogged.nomRestaurant}" size="20" maxlenght="20"/>
<h:outputText value="" />
<h:outputText value="" />
<h:outputText value="Adresse du restaurant" style="FONT-SIZE: small; padding:50px; COLOR: #c0c0c0;" for="AdresseRestaurant"/>
<h:inputTextarea id="AdresseRestaurant" required="true" value="#{AuthentificationBean.partenaireLogged.adrRestuarnat}" style=" width : 149px;"/>
<h:outputText value="" />
<h:outputText value="" />
<h:outputText value="Le fiche descriptif" style="FONT-SIZE: small; padding:50px; COLOR: #c0c0c0;" for="ficheDescriptif"/>
<h:inputTextarea id="ficheDescriptif" required="true" value="#{AuthentificationBean.partenaireLogged.fichDescriptive}" style=" width : 148px;"/>
<h:outputText value="" />
<h:outputText value="" />
<h:outputText value="Numéro du téléphone" style="FONT-SIZE: small; padding:50px; COLOR: #c0c0c0;" for="NuméroTéléphone"/>
<h:inputText id="NuméroTéléphone" required="true" value="#{AuthentificationBean.partenaireLogged.telRestaurant}" size="20" maxlenght="20">
<f:convertNumber/>
</h:inputText>
<h:outputText value="" />
<h:outputText value="" />
<h:outputText for="PrixMaximum" value="Le prix maximum" style="FONT-SIZE: small; padding:50px; COLOR: #c0c0c0;"/>
<h:inputText id="PrixMaximum" required="true" value="#{AuthentificationBean.partenaireLogged.prixMinimum}" size="20" maxlenght="20">
<f:convertNumber />
</h:inputText>
<h:outputText value="" />
<h:outputText value="" />
<h:outputText for="SpécialitéRestaurant" value="Spécialité du restaurant" style="FONT-SIZE: small; padding:50px; COLOR: #c0c0c0;"/>
<h:inputText required="true" id="SpécialitéRestaurant" value="#{AuthentificationBean.partenaireLogged.specialite}" size="20" maxlenght="20"/>
<h:outputText value="" />
<h:outputText value="" />
<h:outputText for="TypeRestaurant" value="Type du restaurant" style="FONT-SIZE: small; padding:50px; COLOR: #c0c0c0;"/>
<h:inputText id="TypeRestaurant" required="true" value="#{AuthentificationBean.partenaireLogged.typePartenaire}" size="20" maxlenght="20"/>
<h:outputText value="" />
<h:outputText value="" />
<h:outputText for="HoraireOuverture" value="Horaire d'ouverture" style="FONT-SIZE: small; padding:50px; COLOR: #c0c0c0;"/>
<h:inputText id="HoraireOuverture" value="#{AuthentificationBean.horaireByIdPartenaire.heureOuverture}" size="20" required="true">
<f:convertDateTime type="time" pattern="HH:mm:ss"/>
</h:inputText>
<h:outputText value="" /><h:outputText value="" />
<h:outputText for="HoraireFermeture" value="Horaire de fermeture" style="FONT-SIZE: small; padding:50px; COLOR: #c0c0c0;"/>
<h:inputText id="HoraireFermeture" value="#{AuthentificationBean.horaireByIdPartenaire.heureFermeture}" size="20" required="true">
<h:outputText value="" />
<f:convertDateTime type="time"/>
</h:inputText>
<h:outputText value="" /><h:outputText value="" />
<p:commandLink update="panel" actionListener="#{AuthentificationBean.updatePartenaire}">
<h:outputText value="Ajax Submit" />
<f:ajax execute="EL"/>
</p:commandLink>
</h:panelGrid>
</p:panel>
</p:tab>
<p:tab title="Espace Menus">
<p:accordionPanel autoHeight="false" dynamic="true" cache="true">
<p:tab title="Salades">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/logoMenu/salades.jpg" />
<p:dataTable id="carList0" var="car" value="#{AuthentificationBean.partenaireSalade}">
<p:column headerText="Nom" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.libelle}" />
</f:facet>
<f:facet name="input">
<h:inputText value="#{car.libelle}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Composants" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.composants}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.composants}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Prix TTC" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.prixTtc}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.prixTtc}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Options">
<p:rowEditor />
</p:column>
</p:dataTable>
</h:panelGrid>
</p:tab>
<p:tab title="Sanduitches">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/logoMenu/sanduitch.jpg" style="width:200px;height:150px"/>
<p:dataTable id="carList1" var="car" value="#{AuthentificationBean.partenaireSanduitches}">
<p:column headerText="Nom" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.libelle}" />
</f:facet>
<f:facet name="input">
<h:inputText value="#{car.libelle}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Composants" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.composants}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.composants}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Prix TTC" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.prixTtc}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.prixTtc}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Options">
<p:rowEditor />
</p:column>
</p:dataTable>
</h:panelGrid>
</p:tab>
<p:tab title="Paninis">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/logoMenu/paninis.jpg" style="width:200px;height:150px"/>
<p:dataTable id="carList2" var="car" value="#{AuthentificationBean.partenairePaninis}">
<p:column headerText="Nom" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.libelle}" />
</f:facet>
<f:facet name="input">
<h:inputText value="#{car.libelle}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Composants" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.composants}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.composants}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Prix TTC" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.prixTtc}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.prixTtc}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Options">
<p:rowEditor />
</p:column>
</p:dataTable>
</h:panelGrid>
</p:tab>
<p:tab title="Plats">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/logoMenu/plat.jpg" style="width:200px;height:150px"/>
<p:dataTable id="carList3" var="car" value="#{AuthentificationBean.partenairePlat}">
<p:column headerText="Nom" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.libelle}" />
</f:facet>
<f:facet name="input">
<h:inputText value="#{car.libelle}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Composants" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.composants}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.composants}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Prix TTC" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.prixTtc}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.prixTtc}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Options">
<p:rowEditor />
</p:column>
</p:dataTable>
</h:panelGrid>
</p:tab>
<p:tab title="Pizzas">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/logoMenu/pizza.jpg" style="width:200px;height:150px"/>
<p:dataTable id="carList4" var="car" value="#{AuthentificationBean.partenairePizza}">
<p:column headerText="Nom" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.libelle}" />
</f:facet>
<f:facet name="input">
<h:inputText value="#{car.libelle}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Composants" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.composants}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.composants}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Prix TTC" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.prixTtc}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.prixTtc}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Options">
<p:rowEditor />
</p:column>
</p:dataTable>
</h:panelGrid>
</p:tab>
<p:tab title="Dessert">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/logoMenu/dessert.jpg" style="width:200px;height:150px"/>
<p:dataTable id="carList5" var="car" value="#{AuthentificationBean.partenaireDessert}">
<p:column headerText="Nom" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.libelle}" />
</f:facet>
<f:facet name="input">
<h:inputText value="#{car.libelle}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Composants" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.composants}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.composants}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Prix TTC" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.prixTtc}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.prixTtc}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Options">
<p:rowEditor />
</p:column>
</p:dataTable>
</h:panelGrid>
</p:tab>
<p:tab title="Boissons">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/logoMenu/boissons.jpg" style="width:200px;height:150px"/>
<p:dataTable id="carList6" var="car" value="#{AuthentificationBean.partenaireBoissons}">
<p:column headerText="Nom" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.libelle}" />
</f:facet>
<f:facet name="input">
<h:inputText value="#{car.libelle}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Composants" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.composants}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.composants}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Prix TTC" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.prixTtc}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.prixTtc}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Options">
<p:rowEditor />
</p:column>
</p:dataTable>
</h:panelGrid>
</p:tab>
</p:accordionPanel>
</p:tab>
</p:tabView>
</h:form>
Mais j'obtient cette erreur:
02/10/2011 12:35:46 م javax.faces.event.MethodExpressionActionListener processAction
SEVERE: Received 'java.lang.NullPointerException' when invoking action listener '#{AuthentificationBean.updatePartenaire}' for component 'j_idt261'
02/10/2011 12:35:46 م javax.faces.event.MethodExpressionActionListener processAction
SEVERE: java.lang.NullPointerException
at com.restaurants.beans.AuthentificationBean.updatePartenaire(AuthentificationBean.java:244)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.el.parser.AstValue.invoke(AstValue.java:191)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:149)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:84)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:773)
at javax.faces.component.UICommand.broadcast(UICommand.java:296)
at javax.faces.component.UIData.broadcast(UIData.java:912)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:781)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1246)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
02/10/2011 12:35:46 م com.sun.faces.context.AjaxExceptionHandlerImpl log
SEVERE: JSF1073: javax.faces.event.AbortProcessingException caught during processing of INVOKE_APPLICATION 5 : UIComponent-ClientId=j_idt15:j_idt16, Message=java.lang.NullPointerException
02/10/2011 12:35:46 م com.sun.faces.context.AjaxExceptionHandlerImpl log
SEVERE: java.lang.NullPointerException
javax.faces.event.AbortProcessingException: java.lang.NullPointerException
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:178)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:84)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:773)
at javax.faces.component.UICommand.broadcast(UICommand.java:296)
at javax.faces.component.UIData.broadcast(UIData.java:912)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:781)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1246)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at com.restaurants.beans.AuthentificationBean.updatePartenaire(AuthentificationBean.java:244)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.el.parser.AstValue.invoke(AstValue.java:191)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:149)
... 22 more
SVP Urgent aider moi.![]()
Partager