Hi,

When you use target.prependJavaScript("some JS code") this generates
<priority-evaluate>.
When you use target.appendJavaScript("some JS code") - <evaluate>.

The difference is that the priority ones are executed first on the client
side, then the components added with target.add() are replaced and finally
the <evaluate> scripts are executed.

Your problem is because of this line:
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js#L135

All client side tasks related to processing an ajax response are put in a
queue and then processed one by one. This is needed because the response
may have header contributions and those should be executed synchronously
(to be able to load their stuff) and because of that an approach with
recursion + self-notification is used.
In your case it seems there are more tasks than what Firefox could handle
in one stack. See https://issues.apache.org/jira/browse/WICKET-4675 for
some more details.


I'll experiment with try/catching the error and call setTimeout. Something
like:


if (this.depth > 1000) {
  // to prevent stack overflow (see WICKET-4675)
  this.depth = 0;
  window.setTimeout(run, 1);
} else {
  try {         
    this.depth ++;
    run();
  } catch (e) {
    if (e.message.indexOf('recursion') > -1) {
      this.depth = 0;

      window.setTimeout(run, 1);

}
 else throw e;
}
}

If this works then there is no reason to use 'depth' at all.



On Wed, Nov 28, 2012 at 10:56 PM, saty <satya...@gmail.com> wrote:

> I receive several of <evaluate> tags within <ajax-response> such as below,
> i
> also receive several
> <priority-evaluate> tags, what are these meant for, reworking an existing
> application so i am not very clear how ajax response works in wicket,  the
> browser craps out parsing one or another of the evaluate tags (too much
> recursion error), is there a way to overcome this parsing.
>
> I understand that these are being generated by several ajax links in my
> application, my goal is to overcome the browser issue with these, its quite
> annoying that application runs fine on Opera but on Firefox (the browser
> used in my firm) this is a serious problem.
>
> <ajax-response>
> .
> .
> .
> <evaluate>
> -
>   </evaluate>
> .
> .
> .
> </ajax-response>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/understanding-ajax-response-tp4654310.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Reply via email to