我使用带有InputTexts,ComboBoxes和Calendars的PrimeFaces表单,但是当我在Calender中选择日期或从ComboBox中选择一个值时,我遇到了问题。
表格代码:
<h:form id="edit">
<p:dialog header="Ajout de Personne" widgetVar="personneAjout"
resizable="false" id="editP" modal="true"
style="height: 1000px !important ; width:1000px !important">
<p:growl id="growl" showDetail="true" sticky="false" life="10000" />
<h:panelGrid id="display" columns="2" cellpadding="4"
style="margin:0 auto ; height: 400px !important; width:250px !important">
<f:facet name="header">
<h:outputLabel for="hed1" value="Formulaire d'ajout de personnel " id="hed1" />
</f:facet>
<p:outputLabel for="personnelMat" title="Nom" value="Matricule :"
style=" color: crimson;" />
<h:inputText value="#{personnelBean.personnel.matricule}" id="personnelMat" required="true"
requiredMessage="Vous devez remplir le champs Matricule." style=" margin: 0; padding: 5px;" />
<p:outputLabel for="nom" title="Nom" value="Nom:" style="color: crimson;" />
<h:inputText value="#{personnelBean.personnel.nom}" id="nom" required="true" requiredMessage="Vous devez remplir le champs Nom."/>
<p:outputLabel for="prenom" value="Prenom:" style="color: crimson;" />
<h:inputText value="#{personnelBean.personnel.prenom}" id="prenom" required="true" requiredMessage="Vous devez remplir le champs Prenom."/>
<p:outputLabel for="personneDateEmbauche" title="Nom" value="Date d'embauche" style="color: crimson;" />
<h:outputLabel for="diplome" title="Nom" value="Diplome" style="color: crimson;" />
<p:calendar value="#{personnelBean.personnel.dateEmbauche}" id="personneDateEmbauche" required="true" />
<h:inputText value="#{personnelBean.personnel.diplome}" id="diplome" required="true" style=" width : 208px; height : 26px; color: crimson;" />
<h:outputText value="Grade : " style="color: crimson;" />
<p:selectOneMenu value="#{personnelBean.personnel.grade}" style="width: 134px ! important;">
<f:selectItem itemLabel="Technicien" itemValue="Technicien" />
<f:selectItem itemLabel="Cadre" itemValue="Cadre" />
<f:selectItem itemLabel="Administratif" itemValue="Administratif" />
</p:selectOneMenu>
<p:outputLabel for="personnelserv" title="Nom" value="Service :" style="color: crimson;" />
<h:inputText value="${personnelBean.service}" id="personnelserv" />
<p:outputLabel for="personnelpost" title="Nom" value="Poste :" style="color: crimson;" />
<h:inputText value="${personnelBean.poste}" id="personnelpost" />
</h:panelGrid>
<p:separator />
<p:commandButton value="Enregistrer"
update=":a:AjoutTab, growl"
actionListener="#{personnelBean.ajoutp(actionEvent) }"
oncomplete="personneAjout.hide()" />
</p:dialog>
</h:form>