You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by vahid ghasemi <va...@gmail.com> on 2022/05/23 11:03:02 UTC

Ajax Error

Hello,
I have the below error and I don't know this is from where and how I should
fix it.
FunctionsExecuter.processNext: ReferenceError: Main is not defined

Re: Ajax Error

Posted by Bas Gooren <ba...@iswd.nl>.
Hi Vahid,

This message is logged when a javascript error occurs while wicket
processes Ajax response items:

https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js?source#L113

My guess is that you (or some code you use) is adding some javascript code
to a wicket Ajax response, which fails.

You could inspect the Ajax response using e.g. chrome developer tools to
see where a “Main” variable is referenced.

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 23 mei 2022 bij 13:03:16, vahid ghasemi (vahidghasemi119@gmail.com)
schreef:

Hello,
I have the below error and I don't know this is from where and how I should
fix it.
FunctionsExecuter.processNext: ReferenceError: Main is not defined

Re: Ajax Error

Posted by Martin Grigorov <mg...@apache.org>.
Hi,


On Mon, May 23, 2022 at 2:03 PM vahid ghasemi <va...@gmail.com>
wrote:

> Hello,
> I have the below error and I don't know this is from where and how I should
> fix it.
> FunctionsExecuter.processNext: ReferenceError: Main is not defined
>

You must be doing something like:
target.appendJavaScript("Main.doSomething()");
But you forgot to contribute the JavaScriptPackageResource that defines
'Main', e.g.

@Override
public void renderHead(IHeaderResponse response) {
   response.render(JavaScriptHeaderItem.forReference(new
JavaScriptResourceReference(MyClass.class, "some.js")))
}