Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5039

Manual invocation of FunctionsExecutor#notify() is broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 6.4.0
    • 6.7.0
    • wicket
    • None
    • any

    Description

      We are having problems on Wicket 1.4.x with and "AJAX function" processEvaluation... and I see the code is practically the same at 6.x. So, let's bring the subject to the list...

      Our problem is that after evaluating some expressions with errors, screen "freezes" because post-call handlers are not called. Problem seems to be related to the code.

      // test if the javascript is in form of identifier|code
      // if it is, we allow for letting the javascript decide when the rest of processing will continue
      // by invoking identifier();
      var res = text.match(new RegExp("^([a-z|A-Z_][a-z|A-Z|0-9_])\\|((.|
      n)
      )$"));

      if (res !== null) {
      var f = jQuery.noop;
      text = "f = function(" + res[1] + ")

      {" + res[2] + "}

      ;";

      try

      { // do the evaluation eval(text); f(notify); } catch (exception) { Wicket.Log.error("Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: " + exception + ", text: " + text); }

      }


      In case of error. Shouldn't it be

      try { // do the evaluation eval(text); f(notify); }

      catch (exception)

      { Wicket.Log.error("Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: " + exception + ", text: " + text); notify(); }

      So that next steps in processing get called. The above solves or freezing problem in case of error

      Attachments

        1. wicket5039.tar.gz
          21 kB
          Ernesto Reinaldo Barreiro
        2. WICKET-5039.patch
          0.6 kB
          Ernesto Reinaldo Barreiro

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              reiern70 Ernesto Reinaldo Barreiro
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: