Re: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException when provider data for DataTable changes before paging (Wicket 6.x up to and including 6.15.0)

2014-06-11 Thread Oddgeir Bell

It's not our component, but a Wicket component:
org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxNavigationToolbar

We add it like this:
datatable.addBottomToolbar(new AjaxNavigationToolbar(this));

And then I would assume it took care of itself, and updated the table when it 
needed to...

Regards,
Oddgeir


It seems the link is already disabled when you click on it.

Which component do you update via Ajax after deleting the row? It seems
the browser isn't showing the latest state of the table.

Regards
Sven



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



Re: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException when provider data for DataTable changes before paging (Wicket 6.x up to and including 6.15.0)

2014-06-11 Thread Martin Grigorov
Hi,

On Wed, Jun 11, 2014 at 8:55 AM, Oddgeir Bell oddgeir.b...@deltasoft.no
wrote:

 It's not our component, but a Wicket component:
 org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.
 AjaxNavigationToolbar

 We add it like this:
 datatable.addBottomToolbar(new AjaxNavigationToolbar(this));

 And then I would assume it took care of itself, and updated the table when
 it needed to...


No.
You should repaint the table after deleting a row to update the toolbars
automatically.
Otherwise you can repaint just the toolbars, or even just this specific
toolbar, but you have to do it yourself.



 Regards,
 Oddgeir


  It seems the link is already disabled when you click on it.

 Which component do you update via Ajax after deleting the row? It seems
 the browser isn't showing the latest state of the table.

 Regards
 Sven



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




Re: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException when provider data for DataTable changes before paging (Wicket 6.x up to and including 6.15.0)

2014-06-11 Thread Oddgeir Bell
How can we? The deletion doesn't happen on the same page. Without 
polling (or websocket), I don't see how we can update the table?
Every time we click a navigation button (in the table), the dataprovider 
fetches the data from the database. It just so happens that that data 
has been changed between clicks, and by then it would be too late to 
update the toolbar (not to mention wrong to update the toolbar from the 
dataprovider). Right?


regards
Oddgeir

On 11.06.2014 09:34, Martin Grigorov wrote:

Hi,

On Wed, Jun 11, 2014 at 8:55 AM, Oddgeir Bell oddgeir.b...@deltasoft.no
wrote:


It's not our component, but a Wicket component:
org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.
AjaxNavigationToolbar

We add it like this:
datatable.addBottomToolbar(new AjaxNavigationToolbar(this));

And then I would assume it took care of itself, and updated the table when
it needed to...


No.
You should repaint the table after deleting a row to update the toolbars
automatically.
Otherwise you can repaint just the toolbars, or even just this specific
toolbar, but you have to do it yourself.



Regards,
Oddgeir


  It seems the link is already disabled when you click on it.

Which component do you update via Ajax after deleting the row? It seems
the browser isn't showing the latest state of the table.

Regards
Sven



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






Re: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException when provider data for DataTable changes before paging (Wicket 6.x up to and including 6.15.0)

2014-06-11 Thread Martin Grigorov
I see.

In this case you can use AbstractRequestCycleListener#onException() to
catch ListenerInvocationNotAllowedException and repaint the whole page
instead of logging it and showing an error page.
I.e. you need to do:
return new RenderPageRequestHandler(new
PageProvider(exception.getComponent().getPage()))

Martin Grigorov
Wicket Training and Consulting


On Wed, Jun 11, 2014 at 10:02 AM, Oddgeir Bell oddgeir.b...@deltasoft.no
wrote:

 How can we? The deletion doesn't happen on the same page. Without polling
 (or websocket), I don't see how we can update the table?
 Every time we click a navigation button (in the table), the dataprovider
 fetches the data from the database. It just so happens that that data has
 been changed between clicks, and by then it would be too late to update the
 toolbar (not to mention wrong to update the toolbar from the dataprovider).
 Right?

 regards
 Oddgeir


 On 11.06.2014 09:34, Martin Grigorov wrote:

 Hi,

 On Wed, Jun 11, 2014 at 8:55 AM, Oddgeir Bell oddgeir.b...@deltasoft.no
 wrote:

  It's not our component, but a Wicket component:
 org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.
 AjaxNavigationToolbar

 We add it like this:
 datatable.addBottomToolbar(new AjaxNavigationToolbar(this));

 And then I would assume it took care of itself, and updated the table
 when
 it needed to...

  No.
 You should repaint the table after deleting a row to update the toolbars
 automatically.
 Otherwise you can repaint just the toolbars, or even just this specific
 toolbar, but you have to do it yourself.


  Regards,
 Oddgeir


   It seems the link is already disabled when you click on it.

 Which component do you update via Ajax after deleting the row? It seems
 the browser isn't showing the latest state of the table.

 Regards
 Sven


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






Re: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException when provider data for DataTable changes before paging (Wicket 6.x up to and including 6.15.0)

2014-06-11 Thread Oddgeir Bell
This works, thank you. We still get the stacktrace in the log, but 
that's ok..


Thank you very much.

regards
Oddgeir

On 11.06.2014 10:32, Martin Grigorov wrote:

I see.

In this case you can use AbstractRequestCycleListener#onException() to
catch ListenerInvocationNotAllowedException and repaint the whole page
instead of logging it and showing an error page.
I.e. you need to do:
return new RenderPageRequestHandler(new
PageProvider(exception.getComponent().getPage()))

Martin Grigorov
Wicket Training and Consulting


On Wed, Jun 11, 2014 at 10:02 AM, Oddgeir Bell oddgeir.b...@deltasoft.no
wrote:


How can we? The deletion doesn't happen on the same page. Without polling
(or websocket), I don't see how we can update the table?
Every time we click a navigation button (in the table), the dataprovider
fetches the data from the database. It just so happens that that data has
been changed between clicks, and by then it would be too late to update the
toolbar (not to mention wrong to update the toolbar from the dataprovider).
Right?

regards
Oddgeir


On 11.06.2014 09:34, Martin Grigorov wrote:


Hi,

On Wed, Jun 11, 2014 at 8:55 AM, Oddgeir Bell oddgeir.b...@deltasoft.no
wrote:

  It's not our component, but a Wicket component:

org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.
AjaxNavigationToolbar

We add it like this:
datatable.addBottomToolbar(new AjaxNavigationToolbar(this));

And then I would assume it took care of itself, and updated the table
when
it needed to...

  No.

You should repaint the table after deleting a row to update the toolbars
automatically.
Otherwise you can repaint just the toolbars, or even just this specific
toolbar, but you have to do it yourself.


  Regards,

Oddgeir


   It seems the link is already disabled when you click on it.


Which component do you update via Ajax after deleting the row? It seems
the browser isn't showing the latest state of the table.

Regards
Sven



-
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



Re: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException when provider data for DataTable changes before paging (Wicket 6.x up to and including 6.15.0)

2014-06-11 Thread jchappelle
By the way that is exactly how we handle these errors as well. The only time
I ever see ListenerInvocationNotAllowedExceptions are when the state of the
database changes between clicks. With repainting the screen the users may
click a link and then the link disappears which is weird. But that is way
better than redirecting them to an error page.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-core-request-handler-ListenerInvocationNotAllowedException-when-provider-data-for--tp4666171p4666206.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



Re: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException when provider data for DataTable changes before paging (Wicket 6.x up to and including 6.15.0)

2014-06-10 Thread Sven Meier
12:26:02,310 WARN [org.apache.wicket.RequestListenerInterface] 
(http--0.0.0.0-8203-2) behavior not enabled; ignore call.
Behavior 
org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationIncrementLink$1@609bfc99 
at component


It seems the link is already disabled when you click on it.

Which component do you update via Ajax after deleting the row? It seems 
the browser isn't showing the latest state of the table.


Regards
Sven


On 06/10/2014 10:07 AM, Oddgeir Bell wrote:

Hello,

I have a 
org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable 
with a 
org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider.

The dataprovider gets data from a database-table.
We add an AjaxNavigationToolbar to the datatable.

Everything works fine, most of the time, BUT there is one case where a 
problem arises:
We have set rowsPerPage to 20, and we have 21 rows in the 
database-table. If we show the initial datatable, delete one row from 
the database, and then try to go to the next page (which now doesn't 
exist, since we have 20 rows per page and 20 rows), we get an 
exception (instead of what I would assume: stay on the 1st page and 
remove the navigation-buttons):
12:26:02,310 WARN  [org.apache.wicket.RequestListenerInterface] 
(http--0.0.0.0-8203-2) behavior not enabled; ignore call. Behavior 
org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationIncrementLink$1@609bfc99 
at component [AjaxPagingNavigationIncrementLink [Component id = next]]
12:26:02,312 WARN  [RequestCycleExtra] (http--0.0.0.0-8203-2) 

12:26:02,313 WARN  [RequestCycleExtra] (http--0.0.0.0-8203-2) Handling 
the following exception: 
org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: 
Behavior rejected interface invocation. Component: 
[AjaxPagingNavigationIncrementLink [Component id = next]] Behavior: 
org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationIncrementLink$1@609bfc99 
Listener: [RequestListenerInterface name=IBehaviorListener, 
method=public abstract void 
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
at 
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:237) 
[wicket-core-6.9.0.jar:6.9.0]
at 
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:247) 
[wicket-core-6.9.0.jar:6.9.0]
at 
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:226) 
[wicket-core-6.9.0.jar:6.9.0]
at 
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:861) 
[wicket-core-6.9.0.jar:6.9.0]
at 
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) 
[wicket-request-6.9.0.jar:6.9.0]
at 
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261) 
[wicket-core-6.9.0.jar:6.9.0]
at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218) 
[wicket-core-6.9.0.jar:6.9.0]
at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289) 
[wicket-core-6.9.0.jar:6.9.0]
at 
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259) 
[wicket-core-6.9.0.jar:6.9.0]
at 
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201) 
[wicket-core-6.9.0.jar:6.9.0]
at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282) 
[wicket-core-6.9.0.jar:6.9.0]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) 
[jbossweb-7.0.13.Final.jar:]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) 
[jbossweb-7.0.13.Final.jar:]
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) 
[jbossweb-7.0.13.Final.jar:]
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) 
[jbossweb-7.0.13.Final.jar:]
at 
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) 
[jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at 
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) 
[jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) 
[jbossweb-7.0.13.Final.jar:]
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
[jbossweb-7.0.13.Final.jar:]
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
[jbossweb-7.0.13.Final.jar:]
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) 
[jbossweb-7.0.13.Final.jar:]
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) 
[jbossweb-7.0.13.Final.jar:]