7 Replies Latest reply on Jan 12, 2010 9:30 AM by Luca Molteni

    Strange Behaviour using tabPanel it does not select Tab

    Luca Molteni Newbie

      I've found a strange behaviour using rich:tabPanel in RichFaces 3.3.0.GA and Facelets 1.1.14


      The problem occurs when I try to nest a tabPanel in a rich:panel, simpleTogglePanel, or h:panelGrid.


      The panel is in server mode.  It suddenly switch to first tab.


      It's not that easy to reproduce: If I've got three tabs: 

       

      • click on 1
      • click on 2
      • click on 3
      • click on 2
      • click on 3

       

      Sometimes (random) it goes to the first tab, instead of going to the third tab.


      The tabs are not generated dynamically, but they are written in xml page.  I've got some custom tags in a taglib in another project (referenced via jar).


      This happens when I try to insert a rich:tabPanel between my custom tags using in my tags there are no forms (a4j:form o h:form).


      My custom tags are defined in facelets using a taglib.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE html

              PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"

            xmlns:rich="http://richfaces.ajax4jsf.org/rich" xmlns:f="http://java.sun.com/jsf/core"

            xmlns:ui="http://java.sun.com/jsf/facelets"

            xml:lang="en" lang="en">

      <head>

          <title></title>

      </head>

      <body>


      <ui:insert />


      </body>

      </html>

       

      this is defined as customtag in my taglib.xml (in an external jar)

       

      When I use it

       

      <x:customtag  xmlns:x="http://www.mynamespace.com" xmlns:rich="http://richfaces.org/rich"

                  xmlns:s="http://jboss.com/products/seam/taglib" xmlns:h="http://java.sun.com/jsf/html"

                  xmlns:f="http://java.sun.com/jsf/core">

          <rich:tabPanel valueChangeListener="#{controller.changeTabAction}" id="tab" switchType="server">

              <rich:tab id="firstTab">

                     First

              </rich:tab>

              <rich:tab id="secondtab">

                  Second tab

              </rich:tab>

              <rich:tab id="thirdtab">

                  Third tab

              </rich:tab>

          </rich:tabPanel>

      </x:customtag>

       

      This behaviour occurs.

       

      Any ideas?

       

      Thanks.