Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

richfaces Process Bar (progress bar)  RSS feed

 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • 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:





 
Tim Holloway
Bartender
Posts: 18704
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!