1
votes

Recently I've migrated from Wicket 1.4 to Wicket 1.5.

I've got problem Panel with AjaxSelfUpdatingTimerBehavior added to ModalWindow.

Closing modal Window does not stop the timer, so when it expires it tries to connect with (non-visible) Panel.

New Wicket release does not allow AJAX requests from disabled/non-visible components so I see "behavior not enabled; ignore call." warning in logs and "Access denied" on Page.

Any ideas how to fix it?

  • calling AjaxSelfUpdatingTimerBehavior.stop() from WindowClosedCallback does not work
1

1 Answers

1
votes

Override canCallListenerInterface(Component component, Method method) in AjaxSelfUpdatingTimerBehavior

/**
 * Overridden to get rid of "Access Denied" error after closing Modal Window
 */
@Override
public boolean canCallListenerInterface(Component component, Method method) {
    if(SelfupdatingPanel.this.equals(component) && 
            method.getDeclaringClass().equals(org.apache.wicket.behavior.IBehaviorListener.class) &&
            method.getName().equals("onRequest")){
        return true;
    }
    return super.canCallListenerInterface(component, method);
}

Note that class.getMethod("onRequest", (Class)null) throws NoSuchMethodException since onRequest() is not public