aspose file tools
The moose likes JSF and the fly likes richfaces Process Bar (progress bar) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "richfaces Process Bar (progress bar)" Watch "richfaces Process Bar (progress bar)" New topic
Author

richfaces Process Bar (progress bar)

Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 114
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:





Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14456
    
    7

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: richfaces Process Bar (progress bar)
 
Similar Threads
rich tabpanel : first rich tab not loaded with focus with first tab
richfaces modal panel perfromance
How to integrate progressBar in my project
Clearing h:inputText value
Validation Problem ... again!