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

AjaxFormChoiceComponentUpdatingBehavior just updates the group "grandchildren"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.1
    • 1.3.3
    • wicket
    • None

    Description

      Up to 1.3.0, there was a bug in that AjaxFormChoiceComponentUpdatingBehavior updated just the group's direct children. Now it generates the header script quoted below, that iterates over the direct children and then over the children of these, triggering the event for the input grandchildren only. So the situation is even worse. I think that attachChoiceHandlers should descend recursively and search for input elements along all the group descendants, not just one arbitrarily chosen level.

      function attachChoiceHandlers(markupid, callbackscript) {
      var choiceElementGroup = document.getElementById(markupid);
      for( var x = 0; x < choiceElementGroup.childNodes.length; x++ ) {
      var choiceElementList = choiceElementGroup.childNodes[x]; for( var y = 0; y < choiceElementList.childNodes.length; y++ ) {
      if (choiceElementList.childNodes[y] && choiceElementList.childNodes[y].tagName) {
      var tag = choiceElementList.childNodes[y].tagName.toLowerCase();
      if (tag == 'input')

      { Wicket.Event.add(choiceElementList.childNodes[y],'click', callbackscript); }

      }
      }
      }
      }

      Attachments

        Activity

          People

            jcompagner Johan Compagner
            memeplex Carlos Pita
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: