[PrimaFaces] Récupérer la valeur du champ d'un formulaire
Bonjour,
Je suis débutant en développement web et je suis en en train de développer un tableau de bord en utilisant le JSF 2.8 avec PrimeFaces.
J'ai du problème pour récupérer la valeur du champ d'un formulaire en utilisant une servlet ou un ManagedBean.
Quelqu'un saurait-il me guider un peu ?
Merci d'avance pour votre aide.
1 pièce(s) jointe(s)
quelqu'un peux me corriger ?
voila mon code page xhtml
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 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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
| <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<div align="center">
<p:fieldset style="width:300px ; font-family:Times New Roman, Times, serif; " legend="Tva Colllecté" toggleable="true" toggleSpeed="300">
<h:form id="for">
<p:panelGrid columns="2" style="font-size:15px" >
<p:outputLabel name="for" style="width:100px" value="Entite" />
<p:inputText id="ent" value="#{tableau.entite}" />
<p:outputLabel name="for" value="Année début" style="width:100px" />
<p:calendar id="debut" pattern="yyyyMMdd" value="#{tableau.annedebut}" >
</p:calendar>
<p:outputLabel style="width:100px" name="for" value="Année fin"/>
<p:calendar id="fin" pattern="yyyyMMdd" value="#{tableau.annefin}" >
</p:calendar>
<f:facet name="footer">
<p:commandButton icon="ui-icon-search" value="Envoyer" action="TvaCollecte.xhtml?faces-redirect=true" >
</p:commandButton>
</f:facet>
</p:panelGrid>
</h:form>
</p:fieldset >
</div>
<br />
<div align="center">
<h:form id="form" >
<p:dataTable id="table" var="tva" value="#{tableau.tvaCollecte}" rows="7"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,50" style="font-size:13px ;width:800px ;size:10px ; font-family:Times New Roman " >
<f:facet name="header">
<p:commandButton id="toggler" type="button" value="Columns"
style="float:left" icon="ui-icon-calculator" />
<p:columnToggler datasource="table" trigger="toggler" />
Tableux Des Tva Collecté Poulina PGH
<br />
<h:commandLink>
<p:graphicImage value="/resources/css/téchar/excel.jpg" width="24" />
<p:dataExporter type="xls" target="table" fileName="Tva Collecte" pageOnly="false" />
</h:commandLink>
<h:commandLink>
<p:graphicImage value="/resources/css/téchar/pdf.png" width="24" />
<p:dataExporter type="pdf" target="table" fileName="Tva Collecte" pageOnly="false" />
</h:commandLink>
<h:commandLink>
<p:graphicImage value="/resources/css/téchar/csv1.png" width="24"/>
<p:dataExporter type="csv" target="table" fileName="Tva Collecte" pageOnly="false" />
</h:commandLink>
</f:facet>
<p:column style="width:24px">
<p:commandLink update=":form:panel" oncomplete="PF('documentDialog').show()" title="View Detail" styleClass="ui-icon ui-icon-search">
<f:setPropertyActionListener value="#{tva}" target="#{tableau.selectedTableau}" />
</p:commandLink>
</p:column>
<p:column headerText="Code entite">
<h:outputText value="#{tva.codeentite}" />
</p:column>
<p:column headerText="Description">
<h:outputText value="#{tva.description}" />
</p:column>
<p:column filterBy="#{tva.designation}" headerText="Désignation">
<h:outputText value="#{tva.designation}" />
</p:column>
<p:column headerText="Taux">
<h:outputText value="#{tva.taux}" />
</p:column>
<p:column headerText="MHT">
<h:outputText value="#{tva.montant}" />
</p:column>
<p:column headerText="Tva">
<h:outputText value="#{tva.tva}" />
</p:column>
<p:column headerText="Fodec">
<h:outputText value="#{tva.fodec}" />
</p:column>
<p:column headerText="Av">
<h:outputText value="#{tva.av}" />
</p:column>
</p:dataTable>
<!--
<p:dialog header="Commande Num: #{car.numcde}" showEffect="fade" Style="font-size:10px " widgetVar="documentDialog" modal="true" hideEffect="explode" resizable="false">
<p:outputPanel id="panel" >
<p:panelGrid columns="2" >
<h:outputLabel value="Code entite " />
<h:outputText value="#{tableau.selectedTableau.codeentite}" style="font-weight:bold" />
<h:outputLabel value="Departement " />
<h:outputText value="#{tableau.selectedTableau.departement}" style="font-weight:bold" />
<h:outputLabel value="Numbr " />
<h:outputText value="#{tableau.selectedTableau.numbr}" style="font-weight:bold" />
<h:outputLabel value="Code fournisseur " />
<h:outputText value="#{tableau.selectedTableau.codefournisseur}" style="font-weight:bold" />
<h:outputLabel value="Fournisseur " />
<h:outputText value="#{tableau.selectedTableau.fournisseur}" style="font-weight:bold" />
<h:outputLabel value="Date Reception" />
<h:outputText value="#{tableau.selectedTableau.datereception}" style="font-weight:bold" />
<h:outputLabel value="Num Commande " />
<h:outputText value="#{tableau.selectedTableau.numcde}" style="font-weight:bold"/>
<h:outputLabel value="Acheteur" />
<h:outputText value="#{tableau.selectedTableau.acheteur}" style="font-weight:bold" />
<h:outputLabel value="Compte achat" />
<h:outputText value="#{tableau.selectedTableau.compteachat}" style="font-weight:bold" />
<h:outputLabel value="Montant" />
<h:outputText value="#{tableau.selectedTableau.montant}" style="font-weight:bold" />
<h:outputLabel value="Type Fournisseur" />
<h:outputText value="#{tableau.selectedTableau.typefournisseur}" style="font-weight:bold" />
<h:outputLabel value="Date Chargement" />
<h:outputText value="#{tableau.selectedTableau.datechargement}" style="font-weight:bold" />
</p:panelGrid>
</p:outputPanel>
</p:dialog>
-->
<p:blockUI block="table" trigger="table">
LOADING<br />
<p:graphicImage name="./images/ajax-loader1.gif"/>
</p:blockUI>
</h:form>
</div>
</h:body>
</html> |