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

AbstractDefaultAjaxBehavior generates broken Javascript

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 1.4.16, 1.5-RC2
    • None
    • wicket
    • n/a

    Description

      org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#generateCallbackScript is generating Javascript code of the form:

      if (condition)

      {Wicket.hideIncrementally()} var wcall = <ajax call code>; Wicket.showIncrementally();

      It should either be:

      if (condition) {Wicket.hideIncrementally(); var wcall = <ajax call code>; Wicket.showIncrementally(); }

      (notice the moved closing brace of the if-block)

      or:

      if (condition) {Wicket.hideIncrementally()}

      var wcall = <ajax call code>; if (condition)

      {Wicket.showIncrementally()}

      Any way, the calls to Wicket.hideIncrementally and Wicket.showIncrementally should be balanced. Now they are not, which may trigger, in some circumstances (when 'condition' == true) a call to showIncrementally when there was never a call to hideIncrementally, disturbing the balance in such a way that the busy indicator keeps spinning forever.

      Also see my related posts on the Wicket User List:

      Possible bug in org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
      http://apache-wicket.1842946.n4.nabble.com/Possible-bug-in-org-apache-wicket-ajax-AbstractDefaultAjaxBehavior-td3335256.html

      With kind regards,

      -Stijn

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            stijndewitt Stijn de Witt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Remaining Estimate - 4h
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified