Re: Threading wicket

2007-10-04 Thread Eelco Hillenius
> how can I force from a middle of the loop, which may run up to few
> minutes to update a component's value?
> I am manipulating a lot of files and I would like to let the user know
> how much of the processing is already done.
> I would like to start processing the files when user reaches certain
> page and on this same page I want to display statistics of the process.
> As an example I tried to use a Clock from your ajax example, but I
> cannot manage it to update during running of the loop. I thought of
> achieving it somehow with threads, is this right direction?
> What is the correct way to do it?

Check out 
org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar.
It's not exactly what you want, but it should give you some ideas.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Threading wicket

2007-10-04 Thread Vit Rozkovec

swaroop belur wrote:


But  mind u- that thread may not have references to stuff like
ur session,application objects- they might be null. So you will have to
first get
the reqd stuff (any dependecies- say something from ur service layer for
example)
and then start the thread. 


-swaroop
  
Would you mind sharing a bit of your code? So far I did 
Application.set(app) in the run() method (app is reference to 
application from standart thread Wicket is running in), but I think this 
is not the right way as the set() method is not part of the public API.


What is the best way to do this?

Thanks alot.

Vitek




Ví­t Rozkovec wrote:
  

Hallo,
how can I force from a middle of the loop, which may run up to few 
minutes to update a component's value?
I am manipulating a lot of files and I would like to let the user know 
how much of the processing is already done.
I would like to start processing the files when user reaches certain 
page and on this same page I want to display statistics of the process.
As an example I tried to use a Clock from your ajax example, but I 
cannot manage it to update during running of the loop. I thought of 
achieving it somehow with threads, is this right direction?

What is the correct way to do it?

Thank you.

Vitek

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Threading wicket

2007-10-04 Thread swaroop belur


If i understand correctly , I think clock example does not work for you 
because your first ajax request - to handle the files - has to first finish. 
Until that finishes the self updating behavior which is a separate ajax
request 
will not fire. So prob  you will have to do ur file stuff in a separate
thread.
But  mind u- that thread may not have references to stuff like
ur session,application objects- they might be null. So you will have to
first get
the reqd stuff (any dependecies- say something from ur service layer for
example)
and then start the thread. 

I was able to update a simple label to the current file number being handled
for 
example. For this i did the file stuff in a separate thread.


-swaroop





Ví­t Rozkovec wrote:
> 
> Hallo,
> how can I force from a middle of the loop, which may run up to few 
> minutes to update a component's value?
> I am manipulating a lot of files and I would like to let the user know 
> how much of the processing is already done.
> I would like to start processing the files when user reaches certain 
> page and on this same page I want to display statistics of the process.
> As an example I tried to use a Clock from your ajax example, but I 
> cannot manage it to update during running of the loop. I thought of 
> achieving it somehow with threads, is this right direction?
> What is the correct way to do it?
> 
> Thank you.
> 
> Vitek
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Threading-wicket-tf4566130.html#a13034201
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Threading wicket

2007-10-04 Thread Gwyn Evans
On Thursday, October 4, 2007, 7:44:44 AM, Vit <[EMAIL PROTECTED]> wrote:

> Hallo,
> how can I force from a middle of the loop, which may run up to few 
> minutes to update a component's value?
> I am manipulating a lot of files and I would like to let the user know
> how much of the processing is already done.
> I would like to start processing the files when user reaches certain 
> page and on this same page I want to display statistics of the process.
> As an example I tried to use a Clock from your ajax example, but I 
> cannot manage it to update during running of the loop. I thought of 
> achieving it somehow with threads, is this right direction?
> What is the correct way to do it?

Spin off a worker thread to do the processing.  This thread has to
periodically update a (shared) field to show the progress.

Independently, your page needs to periodically poll the server (best
via AJAX) to retrieve the value of the shared field - this is where
the AjaxSelfUpdatingBehavior in the Clock example belongs. Unlike
Swing, with web-apps, you can't 'push' from the worker thread, just
'pull' from the client.

/Gwyn


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Threading wicket

2007-10-03 Thread Vit Rozkovec

Hallo,
how can I force from a middle of the loop, which may run up to few 
minutes to update a component's value?
I am manipulating a lot of files and I would like to let the user know 
how much of the processing is already done.
I would like to start processing the files when user reaches certain 
page and on this same page I want to display statistics of the process.
As an example I tried to use a Clock from your ajax example, but I 
cannot manage it to update during running of the loop. I thought of 
achieving it somehow with threads, is this right direction?

What is the correct way to do it?

Thank you.

Vitek

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]