1. Wicket
  2. WICKET-4926

CheckGroupSelector does not work in nested forms in modal windows


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.9
    • Fix Version/s: 6.6.0, 1.5.10
    • Component/s: wicket
    • Labels:
    • Environment:
      Ubuntu 12.10
      JDK 6


      When you have a page with a <form><button that opens modal window><modalwindow></form>.
      Inside that modalwindow I have a form as well. In that form there's a table with a checkGroupSelector.
      When I select the checkGroupSelector, the "findCheckboxesFunction" function can't find the checkboxes since the form passed to the function is the modal window form, so this statement will not work. The checkboxes are not part of that form:

      var parentGroup = parentForm[groupName];

      I've tried passing the correct form, by overriding the getFindCheckboxesFunction() method. Problem is that the nested forms are converted to divs, and therefor the form returned is of type div which causes the previous statement to fail.
      At this time I've fixed this by using jQuery, but a fix in wicket would be nice.

      Wicket.CheckboxSelector.Group.findCheckboxesFunction = function (formId, groupName) {
      return function () {
      var result = new Array();

      var parentForm = wicketGet(formId);
      var parentGroup = jQuery('input[name="' + groupName + '"]');

      if (parentGroup) {
      parentGroup.each(function (index)

      { result.push(this); }

      return result;

      (see http://apache-wicket.1842946.n4.nabble.com/modal-dialog-and-nesting-of-forms-td4395177.html)


        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        28d 19m 1 Carl-Eric Menzel 10/Jan/13 16:06
        In Progress In Progress Resolved Resolved
        23d 20h 12m 1 Sven Meier 03/Feb/13 12:18
        Sven Meier made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Assignee Carl-Eric Menzel [ cmenzel ] Sven Meier [ svenmeier ]
        Fix Version/s 1.5.10 [ 12323510 ]
        Fix Version/s 6.6.0 [ 12323963 ]
        Resolution Fixed [ 1 ]
        Sven Meier added a comment -

        fixed problem inside modal window; simplified; Ajax is not needed as dependency

        Sven Meier added a comment - fixed problem inside modal window; simplified; Ajax is not needed as dependency
        Carl-Eric Menzel made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Martin Grigorov made changes -
        Field Original Value New Value
        Assignee Carl-Eric Menzel [ cmenzel ]
        Sofie Muys created issue -


          • Assignee:
            Sven Meier
            Sofie Muys
          • Votes:
            0 Vote for this issue
            2 Start watching this issue


            • Created: