8 Replies Latest reply on Apr 10, 2007 1:06 PM by nbelaevski

    help getting current tab on client side tab panel

    jersinghaus

      I've got a tab panel set up for client side switching (switchType="client").

      The submit trigger for the page is a double click on a data grid within the tab panel. This is an rcfaces dataGrid.

      I'd like to get the active tab name in my bean so I can execute the double click properly.

      My tab panel is set up this way:

      <rich:tabPanel valueChangeListener="#{taskBean.valueChanged}" style="height: 395px;" switchType="client" width="430" headerAlignment="left"
       binding="#{taskBean.tabPanel}" value="#{taskBean.currentTab}">
      

      Inside my bean, the method called from the double click submit action has this:
      UITabPanel tabPanel = (UITabPanel) getTabPanel();
       Object tabValue = tabPanel.getValue();
      


      No matter what tab is clicked, tabValue holds the same (default value - 1st tab) value.

      Should tabValue hold the current tab even for a tab with switchType="client"?

      If I use value change listeners in this scenario, the listeners aren't called until after the dataGrid action method is called.

      Maybe I need to make an ajax call to pass the current tab to the bean?

      If this is the case, is there an example on how to do this?


      Thanks,
      Joe