Re: set RequestCycle in parallel Thread

2014-01-13 Thread Martin Grigorov
define "didn't work"
put some console.log() statements in the JS to see what is executed

hint: DataTable uses thead element for the toolbars, and tbody for the real
data

Martin Grigorov
Wicket Training and Consulting


On Mon, Jan 13, 2014 at 4:34 PM,  wrote:

> I tried it like this:
> @Override
> protected void updateAjaxAttributes(AjaxRequestAttributes attributes){
> super.updateAjaxAttributes(attributes);
>
> IAjaxCallListener ajaxCallListener = new AjaxCallListener() {
> @Override
> public CharSequence getBeforeHandler(Component component){
> return "var table =
> document.getElementById('searchTable');\n" +
> "var rowCount = table.rows.length;\n" +
> "for (var i = 1; i < rowCount - 1; i++) { \n" +
> " $(\"#searchTable tbody
> tr:eq(\"+i+\")\").each(function(i) {\n" +
> "var offset = $(this).offset();\n" +
> "var veil = $(' class=\"divVeil\">').appendTo('body').css({\n" +
> "position: 'absolute',\n" +
> "top: offset.top,\n" +
> "left: offset.left,\n" +
> "height: $(this).outerHeight(),\n" +
> "width: $(this).outerWidth(),\n" +
> "});\n" +
> "});\n" +
> "}  ";
> }
> };
> attributes.getAjaxCallListeners().add(ajaxCallListener);
> }
>
> But this didn’t work. Can anybody help?
>
>
> 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 13:48
> An: users@wicket.apache.org
> Betreff: Re: set RequestCycle in parallel Thread
>
> See my link to StackOverflow.
> It shows how to "disable" a row. By "disable" it means put a div above the
> row so it receives any clicks. The div may be transparent so your users
> won't notice it.
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Mon, Jan 13, 2014 at 2:42 PM,  wrote:
>
> > I dont want to cover the table. It should be readable for the user. My
> > issue is that the user cant click the toolbars while the request is
> running.
> > This resolution works, I can see the text "'Before ajax call":
> > @Override
> > protected void updateAjaxAttributes(AjaxRequestAttributes
> attributes){
> > super.updateAjaxAttributes(attributes);
> >
> > IAjaxCallListener ajaxCallListener = new AjaxCallListener() {
> > @Override
> > public CharSequence getBeforeHandler(Component component){
> > return "alert('Before ajax call');";
> > }
> > };
> > attributes.getAjaxCallListeners().add(ajaxCallListener);
> > }
> >
> > How can I disable a table in Javascript? It says that wont be possible.
> >
> >
> > 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
> > Ha

Re: set RequestCycle in parallel Thread

2014-01-13 Thread Ernesto Reinaldo Barreiro
Hi,

I mean cover it with a veil: semi-transparent blocking click.
IAjaxIndicatorAware
will make this DIV visible.


On Mon, Jan 13, 2014 at 1:42 PM,  wrote:

> I dont want to cover the table. It should be readable for the user. My
> issue is that the user cant click the toolbars while the request is running.
> This resolution works, I can see the text "'Before ajax call":
> @Override
> protected void updateAjaxAttributes(AjaxRequestAttributes attributes){
> super.updateAjaxAttributes(attributes);
>
> IAjaxCallListener ajaxCallListener = new AjaxCallListener() {
> @Override
> public CharSequence getBeforeHandler(Component component){
> return "alert('Before ajax call');";
> }
> };
> attributes.getAjaxCallListeners().add(ajaxCallListener);
> }
>
> How can I disable a table in Javascript? It says that wont be possible.
>
>
> 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: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Gesendet: Montag, 13. Januar 2014 13:09
> An: users@wicket.apache.org
> Betreff: Re: set RequestCycle in parallel Thread
>
> 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,  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,  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?
> > >
> > >
> > >

Re: set RequestCycle in parallel Thread

2014-01-13 Thread Martin Grigorov
See my link to StackOverflow.
It shows how to "disable" a row. By "disable" it means put a div above the
row so it receives any clicks. The div may be transparent so your users
won't notice it.

Martin Grigorov
Wicket Training and Consulting


On Mon, Jan 13, 2014 at 2:42 PM,  wrote:

> I dont want to cover the table. It should be readable for the user. My
> issue is that the user cant click the toolbars while the request is running.
> This resolution works, I can see the text "'Before ajax call":
> @Override
> protected void updateAjaxAttributes(AjaxRequestAttributes attributes){
> super.updateAjaxAttributes(attributes);
>
> IAjaxCallListener ajaxCallListener = new AjaxCallListener() {
> @Override
> public CharSequence getBeforeHandler(Component component){
> return "alert('Before ajax call');";
> }
> };
> attributes.getAjaxCallListeners().add(ajaxCallListener);
> }
>
> How can I disable a table in Javascript? It says that wont be possible.
>
>
> 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: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Gesendet: Montag, 13. Januar 2014 13:09
> An: users@wicket.apache.org
> Betreff: Re: set RequestCycle in parallel Thread
>
> 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,  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,  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

Re: set RequestCycle in parallel Thread

2014-01-13 Thread Ernesto Reinaldo Barreiro
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,  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,  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,  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 R

Re: set RequestCycle in parallel Thread

2014-01-13 Thread Martin Grigorov
demo of Wicket 6 AjaxRequestAttributes:
https://github.com/martin-g/blogs/blob/master/wicket6-ajax-demo/src/main/java/com/wicketinaction/HandlebarsButton.java#L104

use beforeSend() callback to execute something like:
http://stackoverflow.com/questions/14929095/how-to-add-a-veil-div-to-a-table-row

More docs about Wicket6's improvements in Ajax area:
https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax

Martin Grigorov
Wicket Training and Consulting


On Mon, Jan 13, 2014 at 1:54 PM,  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,  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,  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
> 

Re: set RequestCycle in parallel Thread

2014-01-13 Thread Martin Grigorov
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,  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,  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
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: set RequestCycle in parallel Thread

2014-01-13 Thread Ernesto Reinaldo Barreiro
Why do you need o start a new thread? Is I might ask the question?


On Mon, Jan 13, 2014 at 11:58 AM,  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