-
1. Re: reRender dynamic rich:tabpanel
carlhowarth Jul 6, 2007 6:38 AM (in response to carlhowarth)Hello again,
I have tried using a standard command link and unfortunately the tabs are not re-rendered as I would expect then either.
The getter of the bound object is not being called at all. If I set the tab panel to be transient it does get called, but that is no use to me as the actionlisteners within the tabs then stop functioning.
Please can anybody offer advice?
Thanks in advance, Carl -
2. Re: reRender dynamic rich:tabpanel
carlhowarth Jul 9, 2007 8:49 AM (in response to carlhowarth)Sorry to be a pain in persisting with this but I'm working to a deadline. If the tabpanel simply cannot be rerendered to add/remove tabs dynamically I will need to rethink the UI design somewhat.
Any ideas to get this working would be gratefully received.
Cheers! -
3. Re: reRender dynamic rich:tabpanel
ilya_shaikovsky Jul 9, 2007 9:10 AM (in response to carlhowarth)Sorry for the delay.. Please provide the code you've created for review please.
-
4. Re: reRender dynamic rich:tabpanel
carlhowarth Jul 9, 2007 9:28 AM (in response to carlhowarth)Thanks for the reply - it's a bit difficult to provide all the code; I'll try to provide a better synopsis.
I have a tab panel (that happens to be within a tab of another tabpanel, thus:<rich:tabPanel headerAlignment="right" switchType="client" id="candidatelisttabs" binding="#{mybean.listTabPanelUI}"/>
When the parent tab is selected, an action listener is fired causing the tabs to be populated:
public void generateLists(ActionEvent ev) { if (_listTabPanelUI.getChildren().isEmpty()) { //_listTabPanelUI.setTransient(true); _log.debug("Generating list tabs"); short i = 0; for (CandidateList list : getCandidateListMap().values()) { HtmlTab tab = new HtmlTab(); tab.setLabel(list.getName()); tab.setName(list.getName()); tab.setId(createUniqueIdMethod()); populateDynamicTab(tab, i); _listTabPanelUI.getChildren().add(tab); i++; } } }
The populateDynamicTab method is a little long to provide, but it is working and the tabs are being generated as expected.
Now, from within the dynamically generated tabs I provide a method to delete the object, in this case the 'CandidateList'. The tab is being deleted from the parent collection, then I have tried both_listTabPanelUI.getChildren().clear()
and_listTabPanelUI = new HtmlTabPanel()
after which I call the generateLists() method, expecting the dynamic tab panel to be rerendered on the page, less the deleted tab.
I have put a logger on the get method of the _listTabPanelUI object and it is not being called. The commandbutton used to call the delete method has a rerender property of the tab panel in the format 'formname:candidatelisttabs' and I have also tried surrounding the tabpanel with an a4j:outputPanel, using ajaxRendered=true with layout=block.
The components within the tabs appear to be rerendered, but the tabs themselves are not. As mentioned earlier, if I setTransient(true) on the tab panel when I create it, the tab panel does get rerendered as I would expect, though the action listeners within the tab stop functioning.
I really hope there is a way to get this working, as it looks exactly as I want it to!
Thanks, Carl -
5. Re: reRender dynamic rich:tabpanel
carlhowarth Jul 10, 2007 9:16 AM (in response to carlhowarth)Has the last post been any use in clarifying my issues at all? Please let me know if you require further information.
-
6. Re: reRender dynamic rich:tabpanel
carlhowarth Jul 10, 2007 10:11 AM (in response to carlhowarth)Hi Guys,
I have solved this (I think). Regenerating the tabs from scratch will not work, however if I remove the tab from the tabpanel's collection of children it does work. Happy days!