JSF, javascript et panelGrid
Bonjour!
Je suis débutante en JAVA/J2EE/JSF et je me tire les cheveux sur un problème.
Actuellement, j'ai une page qui affiche des données comme suit :
N° client......Mt total facture
C101 .........199,30
C102 .........678,45
C103 .........123,70
La colonne "Mt total facture" contientla somme des montants des factures associés au client
Cela fonctionne très bien avec le code suivant :
Code:
1 2 3 4 5 6
| <h:dataTable value="#{SessionBeanVisaClient.mfM1}" var="mfM1" cellspacing="0" cellpadding="0" rowClasses="rangPair, rangImpair" width="100%" columnClasses="columnClass10">
<h:column>
<h:outputText value="#{mfM1[0]}" title="#{mfM1[3]}" style="width: 100%; text-align: right;" rendered="#{mfM1[1]}"/>
<h:commandLink value="#{mfM1[0]}" title="#{mfM1[3]}" style="width: 100%; text-align: right;" rendered="#{mfM1[2]}" onclick="ouvrirPDF('#{mfM1[3]}');"/>
</h:column>
</h:dataTable> |
Ce que je voudrais faire maintenant c'est pouvoir afficher en cliquant sur "+" le détail des montants des factures du client :
N° client......Mt total facture
C101 .........-199,30
.....................49,30
.....................50,00
.....................100,00
J'ai bien essayé de transformer mon code avec :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <h:dataTable value="#{SessionBeanVisaClient.mfM_VC}" id="tableau" var="mfM_VC" cellspacing="0" cellpadding="0" rowClasses="rangPair, rangImpair" width="100%" columnClasses="columnClass11">
<h:column>
<h:panelGroup style="width: 100%;">
<h:commandButton id="bibi" styleClass="btStatDetail" value="+" type="reset" rendered="#{mfM_VC[4]}" onclick="javascript:displayDetail(this);"/>
<h:outputText value="#{mfM_VC[0]}" title="#{mfM_VC[3]}" style="width: 100%; text-align: right;" rendered="#{mfM_VC[1]}"/>
<h:commandLink value="#{mfM_VC[0]}" title="#{mfM_VC[3]}" style="width: 100%; text-align: right;" rendered="#{mfM_VC[2]}" onclick="ouvrirPDF('#{mfM_VC[3]}');"/>
</h:panelGroup>
<h:panelGrid columns="1" id="detail_1" width="100%"style="display:none;" cellpadding="0" cellspacing="0" border="0">
<h:commandLink value="123" style="width: 100%; text-align: right;padding:0px;" onclick="window.open('../../html/visa_Chargement_1.htm','','');" />
<h:commandLink value="123" style="width: 100%; text-align: right;padding:0px;" onclick="window.open('../../html/visa_Chargement_1.htm','','');" />
<h:commandLink value="123" style="width: 100%; text-align: right;padding:0px;" onclick="window.open('../../html/visa_Chargement_1.htm','','');" />
</h:panelGrid>
</h:column
</h:dataTable> |
Cela fonctionne bien mais le souci, c'est que je ne sais pas comment faire pour faire afficher dynammiquement les infos dans le panelGrid.
On m'a conseillée d'utiliser une servlet dans ma fonction displayDetail() mais comment récupérer les infos pour les faire afficher dans le panelGrid?
Si vous voyez une autre solution, n'hésitez pas à m'en faire part!!! Ca fait 2 jours que je planche sur une solution et là je ne sais plus où chercher!
Merci de vos conseils!!