You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2013/02/03 13:20:13 UTC

[jira] [Resolved] (WICKET-4926) CheckGroupSelector does not work in nested forms in modal windows

     [ https://issues.apache.org/jira/browse/WICKET-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier resolved WICKET-4926.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 6.6.0
                   1.5.10
         Assignee: Sven Meier  (was: Carl-Eric Menzel)

fixed problem inside modal window; simplified; Ajax is not needed as dependency
                
> CheckGroupSelector does not work in nested forms in modal windows
> -----------------------------------------------------------------
>
>                 Key: WICKET-4926
>                 URL: https://issues.apache.org/jira/browse/WICKET-4926
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.9
>         Environment: Ubuntu 12.10
> JDK 6
>            Reporter: Sofie Muys
>            Assignee: Sven Meier
>            Priority: Minor
>             Fix For: 1.5.10, 6.6.0
>
>
> 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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira