2 Replies Latest reply on Mar 24, 2009 12:47 PM by atulkc

    a4j:push and rich:tabPanel

    atulkc

      I am using a4j:push tags in only one of the tabs of rich:tabPanel (I have multiple tabs in rich:tabPanel). I am using 'ajax' switch type for tabPanel. With this configuration I found that whenever the tab containing a4j:push tag becomes active, method specified in eventProducer attribute of a4j:push is called resulting in registering PushEventListener with backing bean. This results in as many registration calls as many times I switch back and forth between this tab and other tabs. I would like to know if the PushEventListener reference is same every time or will it be different every time the tab is made as 'active' tab. Should I ignore the subsequent calls or always overwrite the PushEventListener my backing bean is holding with the latest reference?

      Also, I found that even though tab containing a4j:push is inactive, a4j:push continues to poll for events (I noticed it by looking at firebug console). Is there a way to prevent this from happening? Since in this case the component a4j:push re-renders is not on client dom polling for event seems un-necessary.

      Any pointers/help with regards to above two questions is appreciated.


      Regards,
      Atul Kshirsagar

        • 1. Re: a4j:push and rich:tabPanel
          ilya_shaikovsky

           

          <a4j:push interval="1000" eventProducer="#{push.addListener}"
           reRender="push,out" enabled="#{userBean.name=='second'}" id="push"/>
           <rich:tabPanel id="tabs" switchType="ajax" selectedTab="#{userBean.name}">
           <rich:tab name="first" label="first" reRender="push,poll">
           <h:outputText value="push inactive" />
           </rich:tab>
           <rich:tab name="second" label="second" reRender="push,poll">
           <h:outputText value="push active" />
           </rich:tab>
           </rich:tabPanel>


          such conditionally enabled push will works as you need.

          • 2. Re: a4j:push and rich:tabPanel
            atulkc

            Thanks Ilya.

            I was having a4j:push tag inside the rich:tab in stead of outside as you have shown in the code sample. Would including the a4j:push tag inside rich:tab, which can be active or in-active, can also result in intermittent re rendering issues I was facing earlier; here is the link to the earlier post:
            http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4205743#4205743