Description
when the application debugsetting AjaxDebugModeEnabled is changed from false to true in an AjaxRequest (e.g. via JMX), the following two statements in AbstractDefaultAjaxBehavior#renderHead are executed:
response.renderJavascript("wicketAjaxDebugEnable=true;", "wicket-ajax-debug-enable");
response.renderJavascriptReference(JAVASCRIPT_DEBUG);
as soon as the client recieves the response, the first javascript statement is executed and code in wicket-ajax.js "thinks" that ajax debug is enabled.
well it is, but wicket-ajax-debug.js has not arrived (or at least has not been processed) yet, and thus Wicket.Log.info() and Wicket.Log.error() will fail, because these methods access an object which is defined in wicket-ajax-debug.js.
This problem seems to be solved by changing the order of the statements in AbstractDefaultAjaxBehavior#renderHead, so that the ResourceReference JAVASCRIPT_DEBUG is rendered before wicketAjaxDebugEnable is set to true.