Affichage des données sur dialog Box
Bonjour, je suis sur un projet jsf, primefaces.J'ai utilisé un datatable et j'ai mis une action commanLink qui permet d'ouvrir le dialog avec les informations de l'objet de la ligne sélectionner. Mon souci est que le dialog box n'affiche pas les informations de l'objet selectionner.
Ma liste datatable est:
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
|
<h:form id="liste">
<p:dataTable id="dataTable" var="ag" value="#{AgentBean.agentListe()}"
paginator="true" rows="10"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15">
<f:facet name="header">
Liste des agents
</f:facet>
<p:column filterBy="#{ag.code}" headerText="Code" filterMatchMode="contains" style="font-size: 13px; padding: 0px 0px;">
<h:outputText value="#{ag.code}" />
</p:column>
<p:column filterBy="#{ag.nom}" headerText="Nom" filterMatchMode="contains" style="font-size: 13px; padding: 0px 0px;" >
<h:outputText value="#{ag.nom}" />
</p:column>
<p:column filterBy="#{ag.prenom}" headerText="Prenom" filterMatchMode="contains" style="font-size: 13px; padding: 0px 0px;">
<h:outputText value="#{ag.prenom}" />
</p:column>
<p:column headerText="Action">
<p:commandLink actionListener="#{AgentBean.ficheagent(ag)}" oncomplete="fiche.show();">
<f:attribute value="#{ag}" name="#{AgentBean.agent}"/>
<p:graphicImage value="/images/list.png" style="text-align: center;"/>
</p:commandLink>
</p:column>
</p:dataTable>
<p:dialog widgetVar="fiche" header="Fiche Agent" showEffect="explode" hideEffect="explode" height="380" width="600" appendToBody="true">
<p:fieldset legend="Informations general">
<h:panelGrid columns="2" style="border: 0;">
<h:outputLabel value="Prenom #{AgentBean.agent.prenom}"/>
<h:outputLabel value="Nom : #{AgentBean.agent.nom}"/>
<h:outputLabel value="Email : #{AgentBean.agent.email}"/>
<h:outputLabel value="Numero Telephone #{AgentBean.agent.numerotel}"/>
<h:outputLabel value="Date Naissance : #{AgentBean.agent.datenaissance}"/>
<h:outputLabel value="Matricule :#{AgentBean.agent.matricule}"/>
</h:panelGrid>
</p:fieldset>
<p:fieldset legend="Detail">
<h:panelGrid columns="1" style="border: 0;">
<h:outputLabel value="Profil : #{AgentBean.agent.profil}"/>
<h:outputLabel value="Qualification : #{AgentBean.agent.qualification}"/>
<h:outputLabel value="Bureau : #{AgentBean.agent.bureau}"/>
</h:panelGrid>
</p:fieldset>
<p:panel style="text-align: center; background: none;">
<p:commandButton value="Fermer" onclick="fiche.hide();" iconPos="right" style="text-align: center;"></p:commandButton>
</p:panel>
</p:dialog>
</h:form> |
Et ma fonction ficheagent(agent) est
Code:
1 2 3 4 5
|
public void ficheagent(Agent ag)
{
this.agent = ag;
} |
Merci de votre aide.