2 Replies Latest reply on Aug 12, 2008 11:17 PM by Carlos Diógenes

    problem use richfaces progress bar

    Carlos Diógenes Newbie

      Hi,


      While trying to use the progress bar I get in troubles.


      I have this subview:


      <f:subview xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:a4j="http://richfaces.org/a4j"
            xmlns:rich="http://richfaces.org/rich"
            xmlns:s="http://jboss.com/products/seam/taglib">
          <rich:modalPanel id="panelDialogo" width="300" height="150">
                <f:facet name="header">
                     <h:panelGroup>
                          <h:outputText value="Aguarde"></h:outputText>
                     </h:panelGroup>
                </f:facet>
                <div align="center">
                     <img src="../img/loader.gif" alt="Aguarde"/>
                     <br/><br/>
                     Esta operação pode demorar vários segundos, aguarde!
                </div>
           </rich:modalPanel> 
           <h:commandButton value="Listar" id="listar" action="#{avlEtpAdcPssFisica.listar}">
                <rich:componentControl for="panelDialogo" attachTo="listar" operation="show" event="onclick"/>
           </h:commandButton>
      </f:subview>



      I also have this sub-view that contains the progress bar.


      <f:subview xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:a4j="http://richfaces.org/a4j"
            xmlns:rich="http://richfaces.org/rich"
            xmlns:s="http://jboss.com/products/seam/taglib">
          <rich:modalPanel id="panelProgresso" width="300" height="150">
                <f:facet name="header">
                     <h:panelGroup>
                          <h:outputText value="Operação em Andamento"></h:outputText>
                     </h:panelGroup>
                </f:facet>
                <div align="center">
                     Aguarde, operação em adamento!
                     <br/><br/>
                     <h:form>
                        <a4j:outputPanel id="progressPanel">
                            <rich:progressBar value="#{progressBarBean.currentValue}"
                                interval="500" label="#{progressBarBean.currentValue} %"
                                minValue="-1" maxValue="100" reRenderAfterComplete="progressPanel"
                                mode="ajax">
                            </rich:progressBar>
                        </a4j:outputPanel>
                    </h:form>
                </div>
           </rich:modalPanel> 
           <s:button       value="Adicionar Avaliados Selecionados" id="adicionar"
                       view="/admin/#{empty avlEtpAdcPssFisicaFrom ? 'AvlDesempenhoList' : avlEtpAdcPssFisicaFrom}.xhtml"
                     action="#{avlEtpAdcPssFisica.adicionarSelecionados}"
                   rendered="#{avlEtpAdcPssFisica.itensSelecionados.size > 0}">
               <rich:componentControl for="panelProgresso" attachTo="adicionar" operation="show" event="onclick"/>
          </s:button>
      </f:subview>



      When I click in the Listar h:commandButton in the first view I get a conversation ended, timed out or was processing another request error.


      I guess that the problem here is due the ajax call being made while processing another request, since my Listar button do things that take a while do execute. I intended to show the progress to the user while this long task was executing, but I don't find a way. I already looked https://jira.jboss.org/jira/browse/JBSEAM-1832 , but it didn't give me any help.


      There is something I can do to make this progress bar work, or there is no way to show this kind of information?


      Thanks and best regards,
      Carlos.

        • 1. Re: problem use richfaces progress bar
          Tony Herstell Master

          This may give you things to look at.


          Why is your button not a rich button?


          You can make all events go through a single event queue (useful as you can slow things down if required) eventsQueue


          You can stop multiple clicks getting through to the server i.e. Remove Duplicates(until a god response is received). ignoreDupResponses


          You can actually ignore clicks for a period of time (this is useful for people who like to click 100 times to see if it breaks). requestDelay


          All these techniques are explained early on in teh RF documentation (See Chapter 5.4.x).


          I HAD to use a combination of all these!


          I even diabled the button after it was clicked in some cases.


          You may get more info off the  Richfaces forum than the seam forum


          Enjoy playing in RF.

          • 2. Re: problem use richfaces progress bar
            Carlos Diógenes Newbie

            The problem was about RTFM :-)


            Seam don't support concurrent calls in beans that are in the conversation scope.


            I tried to put the component where I get the information to update my progress bar in the application scope, but this also don't work. I was only able to make it work when both beans where in the application scope.


            There is any workaround to this?