wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Stoch <daniel.st...@gmail.com>
Subject How to handle click on disabled links - ListenerInvocationNotAllowedException?
Date Tue, 17 Jun 2014 13:55:48 GMT
Hi,

I have a link (or ajax link) which executes some system command. This
system gives me an information if this command is enabled or not, so I
can mark my link as enabled or disabled (by calling
setEnabled(command.isEnabled()) or overriding link.isEnabled()
method).

1. Page is being rendered, command is enabled so link is rendered as enabled.
2. In the meantime system state is changed so command became disabled.
3. User clicks link on a page rendered in step 1 where link is
rendered as enabled but it is disabled now.

In Wicket 1.4 nothing happens in such situation and only warning was logged:
"component not enabled or visible; ignoring call. Component:
[MarkupContainer [Component id = link]]"

In Wicket 6 in such situation the exception is raised:
"ListenerInvocationNotAllowedException: Behavior rejected interface invocation."

How should I handle this correctly to show some information to user,
that this is link is no longer active (but user should stay on the
same page)?
Should I catch ListenerInvocationNotAllowedException inside
IRequestCycleListener.onException()?

--
Daniel

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


Mime
View raw message