Martin Grigorov-4 wrote
> 
> Yes. Just add both to the target when the data is available
> 

Well, I have now managed to get both the textarea updated while my
background thread is running, and the dropdownchoice updated when the thread
is finished. For that I use an AbstractAjaxTimerBehavior that I add to the
textarea component (I guess I could also add it to my Page). Then, on the
onTimer() method I add the textarea and/or the dropdownchoice to the target.
So far, so good. The only problem now is that the timer is running all the
time, even when I do not needed (i.e. even when the background thread is not
running). I would like to start the timer when I launch the background
thread and stop it when the thread is finished. I saw here
(https://issues.apache.org/jira/browse/WICKET-1525) that there are plans to
have a resettable timer. I tried to use the
AbstractAjaxRestartableTimerBehavior class provided there, but I have
encountered a problem. I create an AbstractAjaxRestartableTimerBehavior
timer and add it to my Page. In the onTimer() method I check whether I have
to update the textarea and the dropdownchoice and, if so, I add them to the
target. If I find out that the background thread has finished, I also stop
the timer (i.e. I stop the timer inside the onTimer() method). Everything
works fine until I stop the timer. The onTimer() method finishes ok, but
then I get an "Access Denied" message on the browser and the following
warning:

WARN  - RequestListenerInterface   - behavior not enabled; ignore call.
Behavior test.web.gui.Index$1@17574b9 at component [Page class =
test.web.gui.Index, id = 1, render count = 2]

More details: My Page consists of a textarea, a timer and a form. The form
contains the dropdownchoice. I have tried adding the timer to the textarea,
but get the same error (but for the textarea component). I have tried
submitting the form via Ajax and normally. Same error.

Hope you know what the problem is and can help me.

Cheers,
Humberto

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Update-component-after-background-thread-is-finished-tp4300126p4303428.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to