9 Replies Latest reply on Feb 3, 2012 12:50 PM by peter.knuts

    rich:progressBar - reRenderAfterComplete not working

    rafaelk

      Hello everyone!

      I've got a rich:datatable inside a rich:panel, and the same inside a h:form.
      Inside one of the rich:column in the datatable I have a rich:progressBar taking care of a assinchronous task.

      Actually I have two progressbars, one just for stopped or completed tasks (that got an unique style), and another to expose progress of processing tasks. Once that one of the processing progressbars stopped, I want to reRender all the dataTable.

      But, when a process ends (gets the maximum value of the profress bar) it simple stops polling or reRendering other components, then there's no call to reRenderAfterComplete.

      There's some workaround to make it work?

      Thanks in advance (and sorry for some writting mistake).

        • 1. Re: rich:progressBar - reRenderAfterComplete not working
          ilya_shaikovsky

          which version used?

          check please richfaces-demo - I checked that last reuqest updates outputPanel which wraps PB.

          • 2. Re: rich:progressBar - reRenderAfterComplete not working
            rafaelk

            Richfaces 3.3.1 GA!

            • 3. Re: rich:progressBar - reRenderAfterComplete not working
              ilya_shaikovsky

              please check under 3.3.2SR1 or even better udner 3.3.3 snapshot.

              • 4. Re: rich:progressBar - reRenderAfterComplete not working
                rafaelk

                Hi! thanks for the reply.

                 

                I've tryed either upgrading the version and using the wrap of the outputpanel, the maximum that I can get is just reRendering the progressbar itself.

                As I have a table with other information besides the progress, I need to renderize the table every time that I got a complete task.

                 

                My workaround to it is using an <a4j:poll> reRendering the table in some interval. But it gets some "blink" in the table, a little bit annoying.

                 

                Any another suggestion?

                 

                 

                Thanks!

                • 5. Re: rich:progressBar - reRenderAfterComplete not working
                  ilya_shaikovsky

                  poll not looks like good workaround anyway..

                   

                  please get sources there:

                  http://livedemo.exadel.com/richfaces-demo/richfaces/progressBar.jsf

                   

                  and modify the page like there:

                       <h:form>
                            <a4j:outputPanel id="progressPanel">
                                 <rich:progressBar value="#{progressBarBean.currentValue}"
                                      interval="2000" label="#{progressBarBean.currentValue} %"
                                      enabled="#{progressBarBean.enabled}" minValue="-1" maxValue="50"
                                      reRenderAfterComplete="out">
                                      <f:facet name="initial">
                                           <br />
                                           <h:outputText value="Process doesn't started yet" />
                                           <a4j:commandButton action="#{progressBarBean.startProcess}"
                                                value="Start Process" reRender="progressPanel"
                                                rendered="#{progressBarBean.buttonRendered}"
                                                style="margin: 9px 0px 5px;" />
                                      </f:facet>
                                      <f:facet name="complete">
                                           <br />
                                           <h:outputText value="Process Done" />
                                           <a4j:commandButton action="#{progressBarBean.startProcess}"
                                                value="Restart Process" reRender="progressPanel"
                                                rendered="#{progressBarBean.buttonRendered}"
                                                style="margin: 9px 0px 5px;" />
                                      </f:facet>
                                 </rich:progressBar> 
                            </a4j:outputPanel>
                            <h:outputText value="#{progressBarBean.currentValue}" id="out"/>
                       </h:form>
                  

                  you should be able to see that output text reRendered after completion.. itsn't it?

                  • 6. Re: rich:progressBar - reRenderAfterComplete not working
                    rafaelk

                    Hello there,

                     

                    still not working, I've tried something like getting the System.currentTimeMillis() from a Bean. Then I set two outputs id, one for reRender parameter and another to reRenderAfterComplete.

                    "...
                                                    reRender="example1"
                                                    reRenderAfterComplete="example2"

                    ..."

                    Something like:

                    <h:outputText id="example1" value="#{timeBean.time}" />

                    <h:outputText id="example2" value="#{timeBean.time}" />

                     

                    At the initial rendering of the page, both outputs get the same value. As soon as the task starts processing, the reRender value works well, but in the end of processing, the other output (the associated with the reRenderAfterComplete) still at the same value, that means that reRenderAfterComplete not working.

                     

                    Other point is that the f:facets "initial" and "complete" is not being rendered anyway.

                     

                    Thanks for the help!

                    • 7. Re: rich:progressBar - reRenderAfterComplete not working
                      ilya_shaikovsky
                      seems we using the same code but with different results.. I have no more ideas currently.. So maybe you able to create simple war sample for me to just run and investigate locally?
                      • 8. Re: rich:progressBar - reRenderAfterComplete not working
                        rafaelk

                        Ilka,

                         

                        I really appreciate your help, but that's part of another big system were I've been working and it can be published due to privacity policy of the enterprise =(

                         

                        However, I also work on some personal projects, but they have no progress bars.

                        As soon as I can, I'll try it on them and make some feedback about it.

                         


                        Thanks very much!

                        • 9. Re: rich:progressBar - reRenderAfterComplete not working
                          peter.knuts

                          An acceptable workaround is to use the reRender attribute with an expression similar to

                          reRender="#{conversationBean.shouldUpdateTable ? 'updatedResults':'anyEmptyComponent'}"

                          The 'updateResults' component will then be re rendered as expected in the reRenderAfterComplete expression.

                          More info at: http://achorniy.wordpress.com/2010/10/22/show-dynamic-process-progress-in-seam-richfaces/

                           

                          // Peter