Hi,

Just put a div that covers the table and make it visible (hive it after
AJAX). There are many ways to do this in Wicket one is
using IAjaxIndicatorAware. There was an article on wicket in action page
explaining how to use it (if I recall correctly).


On Mon, Jan 13, 2014 at 12:54 PM, <christoph.ma...@t-systems.com> wrote:

> Can you give a more detailed example? I cant see how I should add
> JavaScript and how I should use the updateAjaxAttributes method.
>
>
> Mit freundlichen Grüßen
> Christoph Manig
> Systems Engineer
>
> T-Systems International GmbH
> Systems Integration - SC Travel, Transport & Logistics
> Hoyerswerdaer Str. 18
> 01099 Dresden
> tel.:   +49 (0) 351 / 8152 - 188
> fax:    +49 (0) 351 / 8152 – 209
> email:  christoph.ma...@t-systems.com
>
> T-SYSTEMS INTERNATIONAL GMBH
> Aufsichtsrat: Thomas Dannenfeldt (Vorsitzender)
> Geschäftsführung: Reinhard Clemens (Vorsitzender), Dr. Ferri Abolhassan,
> Thilo Kusch, Dr. Markus Müller, Georg Pepping, Hagen Rickmann
> Handelsregister: Amtsgericht Frankfurt am Main HRB 55933
> Sitz der Gesellschaft: Frankfurt am Main
> WEEE-Reg.-Nr. DE50335567
>
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Grigorov [mailto:mgrigo...@apache.org]
> Gesendet: Montag, 13. Januar 2014 12:44
> An: users@wicket.apache.org
> Betreff: Re: set RequestCycle in parallel Thread
>
> Hi,
>
> It won't be faster again.
> Your best bet is to use plain JavaScript so that the table is disabled
> before the Ajax call is even made to the server.
> See AjaxRequestAttributes's onBeforeSend() method
> (IndicatingAjaxButton#updateAjaxAttributes()).
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Mon, Jan 13, 2014 at 1:16 PM, <christoph.ma...@t-systems.com> wrote:
>
> > If I only add the behaviour to the button it is not fast enough. If
> > the user clicks the button an sql-statement starts running which
> > collects a lot of data. The delay between clicking the button and
> > disabling the table is too big. That's why I want to do this in a
> parallel thead.
> >
> >
> > Mit freundlichen Grüßen
> > Christoph Manig
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> > Gesendet: Montag, 13. Januar 2014 12:10
> > An: users@wicket.apache.org
> > Betreff: Re: set RequestCycle in parallel Thread
> >
> > 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(TableDisable
> > r.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(TableDisable
> > r.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
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro

Reply via email to