• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

richfaces Process Bar (progress bar)

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to implement progress ( process ) bar example which i need it to my interface , I have just copied the example in the richfaces site.
what i want is that once the user clicks on the button it should call a method which will take some time to finish the processing , while the processing is going , I just want to display a message indicating that there is some process going on .

in the code below once i click on the button it will call the method "processSomething" from mehtod"startProcess" and after finishing processing in this method , it show the processing bar which is not what i want.

it should show the processing bar while the processing is going on in the method "processSomething".

any one can help me to fix this issue

here is the code:





 
Saloon Keeper
Posts: 28468
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's not going to work. An HTTP request doesn't return anything at all until all the code in the request handler has completely finished processing. So you'd get a long delay and then 100%.

To get a progress display, you're going to need to run the long-running display in a separate thread, start the thread in you backing bean, then return to the caller, leaving the thread to run.

You also need to make sure that the thread you start isn't tied to a transient object like a servlet request or you'll run out of HTTP request processors. Traditionally, I've simply set up what I call a "null servlet" whose init() method launched a thread engine which could be petitioned to run the threads on its own resource structure.
 
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic