[PrimeFaces] Problème update FileUpload avec le mode=simple
Bonjour,
J'ai le code suivant :
Code:
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
| <h:form id="telechargercv" enctype="multipart/form-data">
<p:panel id="cv">
<p:messages id="msgs" />
<h:panelGrid columns="2" cellspacing="15">
<h:outputText value="Année d'expérience:" />
<h:selectOneMenu value="#{candidatCtr.candidat.experience}"
style="width:220px;border:solid 1px;border-color:grey;border-radius:3px">
<f:selectItems value="#{candidatCtr.itemsexperience}"></f:selectItems>
</h:selectOneMenu>
<br></br>
</h:panelGrid>
<h:panelGrid columns="1">
<p:fileUpload
value="#{candidatCtr.fileCV}" mode="simple" />
</h:panelGrid>
<br />
<br />
<h:panelGrid columns="2">
<h:outputText value="Votre fichier : " />
<h:outputText value="#{candidatCtr.candidat.cv}" />
</h:panelGrid>
<br></br>
<br />
<br />
<p:commandButton value="#{change.Sauvegarder}" ajax="false"
style="color:#8B4513;border-radius:7px" update="cv"
actionListener="#{candidatCtr.insertionCV}" />
</p:panel>
</h:form>
<h:form id="photoprofil" enctype="multipart/form-data">
<p:panel id="photo">
<p:messages id="msgsphoto" />
<h:panelGrid columns="2">
<p:fileUpload update=":photoprofil:msgsphoto"
value="#{candidatCtr.file}" mode="simple" />
<p:graphicImage style="margin-left:90px"
value="/Piecesjointes/PhotoProfil/#{candidatCtr.candidat.photo}"></p:graphicImage>
<br></br>
<br />
<br />
</h:panelGrid>
<p:commandButton value="#{change.Sauvegarder}"
style="color:#8B4513;border-radius:7px"
update=":photoprofil:msgsphoto" ajax="false"
actionListener="#{candidatCtr.fileUpload}" />
</p:panel>
</h:form> |
Mon problème c'est que lorsque je clique sur n'importe quel button sauvegarder il me fait un update sur la première h:from et la 2éme h:form mais mon but c'est seulement d'actualiser le h:form auquel j'ai fait l'action.
Par exemple si je clique sur le button sauvegarder avec actionListener="#{candidatCtr.fileUpload}" je voudrais que seulement le h:form avec id =photoprofil sera actualisé
Pouvez vous m'aider s'il vous plait??
Merci