Bonjour;
lorsque je clique sur le bouton "Ajouter" le message d'erreur s'affiche deux fois,lorsque je retire ajax="false" , le bouton ne marche pas.
<p:commandButton value="Ajouter" action="#{bean.ajouter}" type="submit" ajax="false"/>
voile la page:
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
| <?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<ui:composition template="./templete.xhtml">
<ui:define name="content">
<p:panel header="Nouveau Engagement" footer="* champ obligatoire">
<f:view>
<p:messages id="messages" showDetail="true" autoUpdate="true"/>
<center>
<h:form>
<br/>
<h:panelGrid columns="2">
<h:outputLabel value="N° Engagement: *" for="numEng" />
<p:inputText id="numeng" value="#{mabean5.engagement.numeng}" label="N° Engagement" size="10" required="true" requiredMessage="N° Engagement est nécessaire." converterMessage="N° Engagement doit être un nombre.">
<f:validateLength minimum="1" maximum="20" />
</p:inputText>
<h:outputLabel value="Type d'Engagement:" for="typeEng" />
<h:selectOneMenu id="typeeng" value="#{mabean5.engagement.typeeng}" style="width: 200px;">
<f:selectItem itemValue="0" itemLabel="Choisir Type" />
<f:selectItem itemValue="Marche"/>
<f:selectItem itemValue="Bon de Commande"/>
</h:selectOneMenu>
</h:panelGrid>
<br/>
<p:commandButton value="Ajouter" action="#{bean.ajouter}" type="submit" ajax="false"/>
<p:commandButton value="Annuler" type="reset"/>
</h:form>
</center>
</f:view>
</p:panel>
</ui:define>
</ui:composition>
</html> |
et voilà templete:
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
| <h:body>
<table style="min-width:1020px;max-width:1020px;min-height:600px" cellspacing="10px" border="0">
<tr>
<td id="titre" colspan="2" height="20%">
<ui:insert name="titre">
titre
</ui:insert>
</td>
</tr>
<tr>
<td id="top" colspan="2" height="20%">
<ui:insert name="top">
<ui:include src="menuhor.xhtml"></ui:include>
</ui:insert>
</td>
</tr>
<tr>
<td id="left" width="15%" valign="top">
<ui:insert name="left">
<ui:include src="menuLeft.xhtml"></ui:include>
</ui:insert>
</td>
<td id="content" width="80%" valign="top">
<ui:insert name="content">Content</ui:insert>
</td>
</tr>
</table>
</h:body> |
svp,comment résoudre ce problème!!
moi utilise jsf et primefaces.
http://www.developpez.net/forums/att...1&d=1346001471
Partager