This content has been marked as final.
Show 1 reply
-
1. Re: How to change active tabs in tabPanel?
utdrew Nov 3, 2008 1:01 PM (in response to daraii)I hacked together this javascript to do it on the client side. The 'pane' argument needs to be the id of the tabpanel your tabs are in. Most of the code was stripped for the richfaces js library for tab panel
function selectNextTab(pane){ var labelSuffix = "_lbl"; var cellSuffix = "_cell"; var shiftedTableSuffix = "_shifted"; var contentSuffix = ""; var tabs = RichFaces.panelTabs[pane]; var FF = RichFaces_FF_Loaded; if(tabs){ var found=false; for( var i=0; i<tabs.length; i++){ var tabi = tabs; var tabId = tabi.id; var tabElement = $(tabId + contentSuffix); var tabLabelId = tabId +labelSuffix; var tabLabel = $(tabLabelId); var shiftedTable = $(tabId + shiftedTableSuffix); if(found && tabElement) { if(RichFaces.onTabChange(null,pane,tabId)) { RichFaces.switchTab(pane,tabId,tabLabel); } break; } if (RichFaces.isTabActive(tabLabelId)) { if(tabElement) { found=true; } } } } }
Drew