0 Replies Latest reply on Sep 10, 2012 12:38 AM by Julian Zorzenon

    IllegalArgumentException with tabPanel

    Julian Zorzenon Newbie

      Hi. I'm getting a weird IllegalArgumentException using the a tabPanel. I have three pages: a page where I declare a menu

       

      <!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:ui="http://java.sun.com/jsf/facelets"

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

                xmlns:h="http://java.sun.com/jsf/html"

                xmlns:a4j="http://richfaces.org/a4j"

                xmlns:rich="http://richfaces.org/rich">

       

       

      <ui:insert name="menu">

                <rich:toolbar itemSeparator="grid" styleClass="menu">

                          <rich:menuItem label="Página principal" action="homeAdmin" mode="server" />

                          <rich:menuItem label="Mensajes" action="mensajesAdmin" mode="server" />

                          <rich:menuItem label="Chat" action="chatAdmin" mode="server" />

                </rich:toolbar>

      </ui:insert>

      </html>

       

       

      the template page

       

      <!DOCTYPE html>

      <html xmlns="http://www.w3.org/1999/xhtml"

                xmlns:h="http://java.sun.com/jsf/html"

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

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

                xmlns:rich="http://richfaces.org/rich">

       

       

      <f:view>

                <h:head>

                          <ui:insert name="head" />

                </h:head>

                <h:body>

                          <h:outputStylesheet library="css"

                                                                            name="styles.css" />

                          <h:form>

                                    <div id="page">

                                              <div style="height: 50px"/>

                                              <ui:include src="menuAdmin.xhtml" />

                                              <ui:insert name="body" />

                                    </div>

                          </h:form>

                </h:body>

      </f:view>

      </html>

       

       

      and a page with a tab panel

       

      <!DOCTYPE html>

      <html xmlns="http://www.w3.org/1999/xhtml"

                xmlns:c="http://java.sun.com/jsp/jstl/core"

                xmlns:a4j="http://richfaces.org/a4j"

                xmlns:h="http://java.sun.com/jsf/html"

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

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

                xmlns:rich="http://richfaces.org/rich">

       

       

      <ui:composition template="/pages/admin/templateAdmin.xhtml">

                <ui:define name="body">

       

                <rich:tabPanel switchType="client">

                          <!-- ayuda -->

                          <rich:tab header="Ayuda">

                                    Bienvenido al inbox de mensajes de los administradores.<br/>

                          </rich:tab>

       

                          <!-- ver mensajes recibidos -->

                          <rich:tab header="Ver Mensajes Recibidos">

                                    <h:form>

                                    <h:outputText value="Texto para buscar:"/>

                                    <br/>

                                    <h:inputText id="textoBuscarEnviados"

                                                                   value="#{mensajeAdminBean.textoBuscar}"

                                                                   style="width: 100%;"/>

                                    <br/>

                                    <h:outputText value="Nombre para buscar:"/>

                                    <br/>

                                    <h:inputText id="nombreBuscarEnviados"

                                                                   value="#{mensajeAdminBean.nombreBuscar}"

                                                                   style="width: 100%;"/>

                                    <br/>

                                    <a4j:commandButton value="Buscar"

                                                                               render="panelMensajesEnviados"

                                                                               execute="textoBuscarEnviados nombreBuscarEnviados"

                                                                               action="#{mensajeAdminBean.buscarMensajesEnviadosAction}"/>

                                    <br/>

                                    </h:form>

       

                                    <a4j:outputPanel id="panelMensajesEnviados"

                                                                             layout="block"

                                                                             style="overflow: auto;">

                                              <a4j:repeat value="#{mensajeAdminBean.mensajesEnviados}"

                                                                            var="mensaje">

                                                        <h:form>

                                                                  #{mensaje.fechaEnvio} - #{mensaje.nombreVecino} escribió:

                                                                  <a4j:commandButton value="Enviar un mensaje a '#{mensaje.nombreVecino}'"

                                                                                     oncomplete="#{rich:component('popupEnviadosEnviarMensaje')}.show();"

                                                                                     render="popupEnviadosEnviarMensaje"

                                                                                     style="float: right;">

                                                                            <a4j:param value="#{mensaje.nombreVecino}"

                                                                                                   assignTo="#{mensajeAdminBean.nombreVecinoSeleccionado}"/>

                                                                  </a4j:commandButton>

                                                                  <br/>

                                                                  #{mensaje.mensaje}

                                                                  <br/>

                                                        </h:form>

                                                        <br/>

                                              </a4j:repeat>

                                    </a4j:outputPanel>

                          </rich:tab>

       

                          <!-- ver mensajes enviados -->

                          <rich:tab header="Ver Mensajes Enviados">

                                    <h:form>

                                    <h:outputText value="Texto para buscar:"/>

                                    <br/>

                                    <h:inputText id="textoBuscarRecibidos"

                                                                   value="#{mensajeAdminBean.textoBuscar}"

                                                                   style="width: 100%;"/>

                                    <br/>

                                    <h:outputText value="Nombre para buscar:"/>

                                    <br/>

                                    <h:inputText id="nombreBuscarRecibidos"

                                                                   value="#{mensajeAdminBean.nombreBuscar}"

                                                                   style="width: 100%;"/>

                                    <br/>

                                    <a4j:commandButton value="Buscar"

                                                                               render="panelMensajesRecibidos"

                                                                               execute="textoBuscarRecibidos nombreBuscarRecibidos"

                                                                               action="#{mensajeAdminBean.buscarMensajesRecibidosAction}"/>

                                    <br/>

                                    </h:form>

       

                                    <a4j:outputPanel id="panelMensajesRecibidos"

                                                                             layout="block"

                                                                             style="overflow: auto;">

                                              <a4j:repeat value="#{mensajeAdminBean.mensajesRecibidos}"

                                                                            var="mensaje">

                                                        <h:form>

                                                                  #{mensaje.fechaEnvio} - #{mensaje.nombreVecino} escribió:

                                                                  <br/>

                                                                  #{mensaje.mensaje}

                                                                  <br/>

                                                        </h:form>

                                                        <br/>

                                              </a4j:repeat>

                                    </a4j:outputPanel>

                          </rich:tab>

                </rich:tabPanel>

       

                <h:form>

                <rich:popupPanel id="popupEnviadosEnviarMensaje"

                                                         modal="true"

                                                         autosized="true"

                                                         resizeable="false"

                                                         header="Enviar un mensaje"

                                                         domElementAttachment="form">

                          <f:facet name="controls">

                           <h:outputLink value="#"

                                                              onclick="#{rich:component('popupEnviadosEnviarMensaje')}.hide();">

                               X

                           </h:outputLink>

                       </f:facet>

                          <h:outputText id="mensaje"

                                                          value="Mensaje:"/>

                          <br/>

                          <h:inputTextarea id="textoEnviar"

                                                                   cols="60"

                                                                   rows="5"

                                                                   value="#{mensajeAdminBean.mensajeEnviar}"

                                                                   style="resize: none;"/>

                          <br/>

                          <a4j:commandButton id="enviarTexto"

                                                                     value="Enviar"

                                                                     execute="textoEnviar"

                                                                     render="mensajeError textoEnviar"

                                                                     action="#{mensajeAdminBean.enviarMensajeAction}"/>

                          <a4j:commandButton id="cerrarPopup"

                                                                     value="Cerrar"

                                                                     oncomplete="#{rich:component('popupEnviadosEnviarMensaje')}.hide();"

                                                                     action="#{mensajeAdminBean.limpiarPopupAction}"/>

                          <br/>

                          <h:outputText id="mensajeError"

                                                          value="#{mensajeAdminBean.mensajeEnvioError}"/>

                          <br/>

                </rich:popupPanel>

                </h:form>

       

                </ui:define>

                <ui:include src="/pages/status.xhtml"/>

      </ui:composition>

      </html>

       

      Initially, I had the same problem of the exception being thrown whenever I click one of the tab on the tabPanel if the switchType was declared as either 'ajax' or 'server'. The only switchType that works is 'client'. But, after a few headaches, I workarounded the problem. But now, I'm getting again the same exception. If I enter the page that has the tabPanel and then I click on one of the menuItem's (no matter wich one) to go to another page the exception is thrown:

       

      java.lang.IllegalArgumentException

                at org.richfaces.component.AbstractTogglePanel.getChildName(AbstractTogglePanel.java:490)

                at org.richfaces.component.AbstractTogglePanel.isActiveItem(AbstractTogglePanel.java:481)

                at org.richfaces.component.AbstractTogglePanel.processDecodes(AbstractTogglePanel.java:205)

                at javax.faces.component.UIForm.processDecodes(UIForm.java:225)

                at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)

                at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)

                at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:933)

                at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

                at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)

                at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)

                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                at java.lang.Thread.run(Unknown Source)

       

      What's causing this??

       

      I'm using richfaces 4.2 final