bonjour
j'essaie d'afficher des informations dans un dataTable qui contient un subTable.
et voici le code :
voici le code de mon bean :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <rich:dataTable id="tableS" value="#{gestionChantiers.items}" var="Sch" onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" cellpadding="0" cellspacing="0" width="100%" border="0" > <core:facet name="header"> <rich:columnGroup> <rich:column rowspan="2"> <rich:spacer /> </rich:column> <rich:column colspan="2"> <html:outputText value="Suivi" /> </rich:column> <rich:column breakBefore="true"> <html:outputText value="Dépenses" /> </rich:column> <rich:column> <html:outputText value="Recettes" /> </rich:column> </rich:columnGroup> </core:facet> <rich:subTable onRowMouseOver="this.style.backgroundColor='#F8F8F8'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" value="#{gestionChantiers.items}" > <rich:column> <html:outputText value="#{Sch.dateSuivi}"/></rich:column> <rich:column> <html:outputText value="#{Sch.depense}"/> </rich:column> <rich:column> <html:outputText value="#{Sch.recette}"/> </rich:column> </rich:subTable> <core:facet name="footer"> <rich:columnGroup> <rich:column>Totals</rich:column> <rich:column> <html:outputText value="#{gestionChantiers.totalDep}"/> </rich:column> <rich:column> <html:outputText value="#{gestionChantiers.totalRec}"/> </rich:column> </rich:columnGroup> </core:facet> </rich:dataTable>
le problème est que les informations s'affichent en double dans le dataTable
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 public List<Suivichantier> getItems(){ try{ Properties p = new Properties( ); p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); p.put(Context.URL_PKG_PREFIXES, " org.jboss.naming:org.jnp.interfaces"); p.put(Context.PROVIDER_URL, "jnp://localhost:1099"); Context ctx; ctx = new InitialContext(p); GestionChantiersRemote Cbean = (GestionChantiersRemote) ctx.lookup("GestionChantiers/remote"); List tempList = Cbean.FindSuiviByCH(ch.getNumChantier()); totalDep =0.0; totalRec = 0.0; totalDep = Cbean.CalculerTotalD(ch.getNumChantier()); totalRec = Cbean.CalculerTotalR(ch.getNumChantier()); ListSuivi.clear(); Iterator iter = tempList.iterator(); while (iter.hasNext()){ Sch = (Suivichantier) iter.next(); ListSuivi.add(Sch); System.out.print(Sch.getDateSuivi()); } }catch(Exception e){ e.printStackTrace(); } return ListSuivi; }
je ne sais pas d'ou ça vient ?? j'appelle la méthode clear() de la liste avant chaque nouvelle itération mais ça ne change rien.
j'ai remarqué que dans le dataTable et le subTable il y'a deux foix l'appel de la méthode du bean est ce que le problème vient d'ici ou bien c'est quelquechose d'autre.
merci pour votre aide
Partager