1 Reply Latest reply on Sep 28, 2007 2:38 AM by Adrian Mitev

    Immediate tabPanel on page makes all form submissions immedi

    Mike Hanafey Newbie

      Setting the "immediate" attribute true on a "tabPanel" has a strange effect -- if the page is submitted by a "commandButton" which is not "immediate='true'", it nevertheless behaves as though it was immediate because the field with "required='true'" does not generate an error. In addition the ajax submission also ends up behaving as it too is "immediate" (no error for the empty field, and the "id='echoField' " component is not updated.

      If the tabPanel is made non-immediate, the expected behaviour happens.

      This appears to be a bug, or am I not understanding what making a tabPanel immediate is supposed to do. I assume it is to allow the selected tab to be changed but short circuiting the life cycle. So why then would a component that is not even a child of the tabPanel be affected??

      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      
      <html>
      <head>
       <title>repeater</title>
      </head>
      
      <body>
      <f:view>
      <h:form id="form">
       <rich:panel header="Errors">
       <rich:messages/>
       </rich:panel>
      
       <rich:panel header="Simple Echo">
       <h:inputText size="50" value="#{bean.text}">
       <a4j:support event="onkeyup" reRender="rep"/>
       </h:inputText>
      
       <h:outputText id="echoField" value="#{bean.text}" id="rep"/>
       </rich:panel>
      
       <rich:panel header="Simple Echoless">
       <h:inputText id="in1" size="50" value="#{bean.junk}" required="true"/><br/>
       <rich:message for="in1"/><br/>
      
       <h:outputText value="#{bean.junk}" id="nonrep"/>
       <h:commandButton value="Submit"/>
       </rich:panel>
      
       <rich:tabPanel id="tabPanel" selectedTab="t2" switchType="server" immediate="true">
       <rich:tab id="t1" label="TabOne">
       <h:outputText value="Content1"/>
       </rich:tab>
       <rich:tab id="t2" label="TabTwo">
       <h:outputText value="Content2"/>
       </rich:tab>
       </rich:tabPanel>
      </h:form>
      </f:view>
      </body>
      </html>