wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: How to handle click on disabled links - ListenerInvocationNotAllowedException?
Date Tue, 17 Jun 2014 14:00:15 GMT
Hi,


On Tue, Jun 17, 2014 at 4:55 PM, Daniel Stoch <daniel.stoch@gmail.com>
wrote:

> 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()?
>

Yes. This is the best you can do in this case.


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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message