start a timer behavior that polls and waits for the thread to finish, and only when its finished it updates the select.
-igor On Mon, Jan 16, 2012 at 8:47 AM, humcasma <humca...@gmail.com> wrote: > Hi, > > I have a simple form. When I submit it I launch a thread that runs on the > background. When the thread is finished, I would like to update a > DropdownChoice with the result generated by the thread. I manage to update > the choice, but the changes are only visible when I refresh the page. To > avoid that, I have used a AjaxEventBehavior to update the choice whenever > the user clicks on it: > > serviceNameChoice = new DropDownChoice<String>("serviceNameChoice", new > Model<String>(), > > serviceNames); > serviceNameChoice.add(new AjaxEventBehavior("onclick") { > protected void onEvent(AjaxRequestTarget target) { > target.add(serviceNameChoice); > } > }); > > The result is an unusable drop-down choice, since the choice keep refreshing > when I try to select a value. > > How can I do what I want, that is, update/refresh a DropdownChoice when a > background thread finishes its work? > Thanks! > > Humberto > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Update-component-after-background-thread-is-finished-tp4300126p4300126.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 > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org