4 Replies Latest reply on Mar 13, 2007 4:31 PM by sergeysmirnov

    Problem with rich:tabPanel

    jtocko

      Hi,
      the following code displays tabPanel ok with 3 headers of tabs,
      but the content of all tabs are displayed above tabPanel and no tabs are displayed,
      what am I doing wrong ?

      Thanks for answer,
      JT

      <%@ page language="java"%>
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich" %>
      <html>
       <body>
       <f:view>
       Here is an example of tab panel switched completely on client.
       <rich:tabPanel switchType="client">
       <rich:tab label="First">
       Here is tab #1
       </rich:tab>
       <rich:tab label="Second">
       Here is tab #2
       </rich:tab>
       <rich:tab label="Third">
       Here is tab #3
       </rich:tab>
       </rich:tabPanel>
       </f:view>
       </body>
      </html>
      [/img]

        • 1. Re: Problem with rich:tabPanel

          The code is correct. Sounds like a general problem using rich faces. Try another richfaces component.
          For example:

          <rich:separator />
          


          When that component won't by displayed, there's sth wrong with your a4J/richfaces configuration (missing .jarFile??)


          • 2. Re: Problem with rich:tabPanel
            mail.micke

            You may need to wrap the tab content in

            <f:verbatim>..</f:verbatim>

            just a guess I'm using Facelets myself :)

            • 3. Re: Problem with rich:tabPanel
              jtocko

              I'm using jar files from jboss-richfaces-3.0.0.zip:
              jboss-richfaces-3.0.0\lib\ajax4jsf-1.1.0.jar
              jboss-richfaces-3.0.0\lib\oscache-2.3.jar
              jboss-richfaces-3.0.0\lib\richfaces-3.0.0.jar

              I followed the steps in Developer guide,
              eg. folowing code works ok - in the same way as in online demo:

              <rich:inputNumberSpinner value="50" step="10" maxValue="100"/>
              <rich:inputNumberSlider value="50"/>
              <rich:separator/>
              <rich:togglePanel id="skin_chooser1" switchType="ajax" stateOrder="s,b">
               <f:facet name="s">
               <h:panelGrid columns="1" style="">
               <h:outputText value="BlueSky" />
               <h:outputText value="Classic" />
               <rich:toggleControl for="skin_chooser1" value="more ..." />
               </h:panelGrid>
               </f:facet>
               <f:facet name="b">
               <h:panelGrid columns="1" style="">
               <h:outputText value="BlueSky" />
               <h:outputText value="Classic" />
               <h:outputText value="Ruby" />
               <h:outputText value="Wine" />
               <h:outputText value="DeepMarine" />
               <h:outputText value="EmeraldTown" />
               <h:outputText value="Sakura" />
               <h:outputText value="Default" />
               <rich:toggleControl for="skin_chooser1" value="... less" />
               </h:panelGrid>
               </f:facet>
              </rich:togglePanel>


              but when I use rich:tabPanel, rich:modalPanel or rich:panel, the content is always outside the components (components are rendered as in online demo, but with no content).

              I've tried to pack the content into
              <f:verbatim>..</f:verbatim>

              or into
              <h:outputText></h:outputText>

              but it doesnt help.

              • 4. Re: Problem with rich:tabPanel

                 

                "jtocko" wrote:
                Hi,
                the following code displays tabPanel ok with 3 headers of tabs,
                but the content of all tabs are displayed above tabPanel and no tabs are displayed,
                what am I doing wrong ?

                Thanks for answer,
                JT

                <%@ page language="java"%>
                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
                <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
                <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
                <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich" %>
                <html>
                 <body>
                 <f:view>
                 Here is an example of tab panel switched completely on client.
                 <rich:tabPanel switchType="client">
                 <rich:tab label="First">
                 Here is tab #1
                 </rich:tab>
                 <rich:tab label="Second">
                 Here is tab #2
                 </rich:tab>
                 <rich:tab label="Third">
                 Here is tab #3
                 </rich:tab>
                 </rich:tabPanel>
                 </f:view>
                 </body>
                </html>
                [/img]


                This will work only if you use Facelets or JSF-RI 1.2

                Otherwise, the pure HTML content is not allowed inside the JSF component.