Hi Maxim, As a workaround you can remove this anonymous class instance by iterating over all behaviors and checking the declaring class of such anonymous classes.
Otherwise https://github.com/apache/wicket/blob/0c58ea590403e147f73bbbaaa4f1266509b2c32a/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java#L164 should be fixed to delegate all its methods to the outer behavior. In your case Behavior#isEnabled(Component) would be useful. On Thu, Apr 12, 2018 at 1:27 PM, Maxim Solodovnik <solomax...@gmail.com> wrote: > Hello, > > I'm struggling with AjaxFormValidatingBehavior > It works as expected, until form is enabled > > In case form is disabled it throws ListenerInvocationNotAllowedException > and breaks the page. > > I decided to remove this behavior dynamically in case Form is disabled > But `remove(behavior)` doesn't > removes AjaxFormValidatingBehavior$FormValidateVisitor$1 ... > > I'm enabling/disabling Form dynamically via Ajax based on the Model being > set > How can I `pause` this behavior? > > > -- > WBR > Maxim aka solomax >