1 Reply Latest reply on Mar 13, 2008 1:37 AM by Kto ToTaki

    Wrong SelectedTab information ?

    Kto ToTaki Newbie

      I try to get correct selectedTab in a page with tabPanel. TabPanel has binding to bean and bean reports different selectedTab every time I change tab in tabPanel ??? The first time I click a tab, selectedTab is correct, but clicking on the same tab next time (after clicking others tab) shows another tab id ?

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

      <rich:tabPanel switchType="ajax" id="productDetail" binding="#{productCatalogMBean.productDetailTab}">
      <rich:tab label="Id" id="tab1">
      <rich:tab label="Beskrivelse" id="tab2">
      <rich:tab label="Levering" id="tab3">
      <rich:tab label="Relasjoner" id="tab4">
      <rich:tab label="Bestillingsskjema" id="tab5">
      <rich:tab label="Saksbehandler" id="tab6">
      <rich:tab label="Prisdata" id="tab7">
      <rich:tab label="Godkjenn" id="tab8">

      private HtmlTabPanel productDetailTab;

      public HtmlTabPanel getProductDetailTab() {
      return productDetailTab;

      public void setProductDetailTab(HtmlTabPanel productDetailTab) {
      this.productDetailTab = productDetailTab;
      if(productDetailTab!=null) {
      String selectedTab = (String) productDetailTab.getSelectedTab();
      if(selectedTab!=null) {

      Why it happens ? Have I forgot something here ?

      Another question is how to change tab to desired tab ?
      I used productDetailTab.setSelectedTab("tab5"); but nothing happens ?