Hello,
Je cherche à afficher une table dynamique dans un tabedSet lui également dynamique,
Je n'ai pas de problèmes à charger de le tabedSet mais lorsque je change de tab le contenu de la table n'est pas mis à jour (la table est toujours celle qui contient les données du premier tab)
Le code JSF est le suivant
et dans mon managed bean lorsque l'index du tab change j'essaye de changer la table dans le setTabIndex
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 <div id="donneesBase" class="exampleBox splashContainer"> <ice:panelGroup xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ice="http://www.icesoft.com/icefaces/component"> <ice:panelGrid columns="4"> <!-- Displayed Tabs --> <ice:panelGroup styleClass="exampleBox panelTabSetContainer"> <ice:panelTabSet var="currentTab" value="#{xxxx.tabs}" selectedIndex="#{xxxx.tabIndex}"> <ice:panelTab label="#{currentTab.label}"> <ice:dataTable id="test" binding="#{xxxx.table}"></ice:dataTable> </ice:panelTab> </ice:panelTabSet> </ice:panelGroup> </ice:panelGrid> </ice:panelGroup> </div>
Mais malheureusement le getTable n'est pas appellé à chaque changement de tab
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 /** * Sets the current tab index * * @param tabIndex * The tab index to set */ public void setTabIndex(int tabIndex) { UIComponent component = this.dynamicTabSet.getChildren().get(tabIndex); List<UIComponent> components = component.getChildren(); for (UIComponent activeComponent : components) { if (activeComponent.getId().equals("tableXXX")) { this.table = (HtmlDataTable) activeComponent; } } this.tabIndex = tabIndex; }
Quelqu'un aurait une piste ?
Partager