Why do you need o start a new thread? Is I might ask the question?
On Mon, Jan 13, 2014 at 11:58 AM, <christoph.ma...@t-systems.com> wrote: > Hello, > > I want to add a new AjaxEventBehaviour to my IndicatingAjaxButton. I do > this the following way: > > public class TableDisabler implements Runnable{ > > private IndicatingAjaxButton button; > > public TableDisabler (IndicatingAjaxButton button){ > this.button=button; > > } > > @Override > public void run() { > button.add(new AjaxEventBehavior("onClick") { > @Override > protected void onEvent(AjaxRequestTarget ajaxRequestTarget) { > CustomDataTable table = > (CustomDataTable)button.getPage().get("searchTable"); > table.setEnabled(false); > ajaxRequestTarget.add(table); > > } > }); > } > } > > When the button is clicked I start this thread, but I get this exception: > Exception in thread "Thread-69" org.apache.wicket.WicketRuntimeException: > No RequestCycle is currently set! > at org.apache.wicket.Component.getRequest(Component.java:1795) > at org.apache.wicket.markup.html.WebPage.dirty(WebPage.java:318) > at org.apache.wicket.Page.dirty(Page.java:255) > at org.apache.wicket.Page.componentStateChanging(Page.java:930) > at org.apache.wicket.Component.addStateChange(Component.java:3519) > at org.apache.wicket.Behaviors.add(Behaviors.java:55) > at org.apache.wicket.Component.add(Component.java:4503) > at > smw.console.frontend.components.support.TableDisabler.run(TableDisabler.java:18) > at java.lang.Thread.run(Thread.java:722) > Exception in thread "Thread-70" org.apache.wicket.WicketRuntimeException: > No RequestCycle is currently set! > at org.apache.wicket.Component.getRequest(Component.java:1795) > at org.apache.wicket.markup.html.WebPage.dirty(WebPage.java:318) > at org.apache.wicket.Page.dirty(Page.java:255) > at org.apache.wicket.Page.componentStateChanging(Page.java:930) > at org.apache.wicket.Component.addStateChange(Component.java:3519) > at org.apache.wicket.Behaviors.add(Behaviors.java:55) > at org.apache.wicket.Component.add(Component.java:4503) > at > smw.console.frontend.components.support.TableDisabler.run(TableDisabler.java:18) > at java.lang.Thread.run(Thread.java:722) > > How can I set an RequestCycle in this Thread, so that the table will be > disabled if the button is clicked? > > Mit freundlichen Grüßen > Christoph Manig > > > -- Regards - Ernesto Reinaldo Barreiro