1 Reply Latest reply on Oct 2, 2013 2:47 PM by jhuska

    queue kills rich:tabPanel with switchType="ajax"

    ibenjes

      Hi

       

      I've found two ways of killing a rich:tabPanel with switchType="ajax" in RF 4.3.4 (or RF 4.3.3), you specify

      a) a queue with the name "org.richfaces.queue.global" on the page or

      b) a queue with no name

       

      When you try to switch tabs you get the ajax request and everything seems to be fine but the tab doesn't change.

       

      here is some example code:

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <ui:composition 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:a="http://richfaces.org/a4j"
       xmlns:s="http://jboss.org/schema/seam/taglib"
       xmlns:rich="http://richfaces.org/rich">
       <f:view>
        <h:head>
        </h:head>
        <h:body>
       <!--  First way of killing the rich:tabPanel, add the global queue -->
        <a:queue name="org.richfaces.queue.global" requestDelay="300"
        ignoreDupResponce="true" />
      
        <h:form id="tform">
      
      
      
        <rich:tabPanel switchType="ajax" id="tabPanelLine2" status="STload">
        <rich:tab header="Tab1">
        <a:commandButton status="STload" styleClass="button"
        execute="@this" value="Test 1" action="#{testBean.action()}" />
        </rich:tab>
        <rich:tab header="Tab2">
        <a:commandButton status="STload" styleClass="button"
        execute="@this" value="Test 2" action="#{testBean.action()}" />
        </rich:tab>
        </rich:tabPanel>
      
        <!-- using a queue with no name kills the tabPanel as well -->
        <a:queue id="testQueue" requestDelay="500" />
        <rich:autocomplete id="testAuto" mode="ajax"
        value="#{testTabBean.car}" layout="div"
        autocompleteMethod="#{testTabBean.suggest}" var="car"
        fetchValue="#{car}" minChars="2" zindex="2001">
        <a:attachQueue name="testQueue" />
        </rich:autocomplete>
      
      
      
      
      
      
      
        </h:form>
      
      
        <a:log />
      
        </h:body>
       </f:view>
      </ui:composition>
      
      

       

      This is the a:log output when clicking on the second tab:

      debug[15:22:37.339]: New request added to queue. Queue requestGroupingId changed to tform:j_idt41

      debug[15:22:37.340]: Queue will wait 500ms before submit

      debug[15:22:37.841]: richfaces.queue: will submit request NOW

      info [15:22:37.847]: Received 'begin' event from <div id=tform:j_idt41 ...>

      info [15:22:38.408]: Received 'beforedomupdate' event from <div id=tform:j_idt41 ...>

      debug[15:22:38.408]: Server returned responseText: <?xml version='1.0' encoding='UTF-8'?> <partial-response><changes><update id="javax.faces.ViewState"><![CDATA[6483379109293241153:2388426771403547678]]></update></changes></partial-response>

      info [15:22:38.409]: Listing content of response changes element:
      Element update for id=javax.faces.ViewState
      <update id="javax.faces.ViewState"><![CDATA[6483379109293241153:2388426771403547678]]></update>

      debug[15:22:38.410]: richfaces.queue: ajax submit successfull

      debug[15:22:38.410]: richfaces.queue: Nothing to submit

      info [15:22:38.410]: Received 'success' event from <div id=tform:j_idt41 ...>

      info [15:22:38.411]: Received 'complete' event from <div id=tform:j_idt41 ...>

       

      Can anyone else confirm this? Is this a know bug or am I the only one with this problem?

       

      What other ways do I have to configure the global queue. I know I can switch it on in web.xml with

      <context-param> <param-name>org.richfaces.queue.global.enabled</param-name>
      <param-value>true</param-value>
      </context-param>
      
      

       

      But I need to use the onstart and oncomplete callbacks.

       

      Message was edited by: Immo Benjes: added RF versions tested against