Nested Forms and *AjaxButton issue
----------------------------------

                 Key: WICKET-1811
                 URL: https://issues.apache.org/jira/browse/WICKET-1811
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.4
         Environment: All
            Reporter: Ritesh Trivedi


Original issue described here
http://www.nabble.com/Nested-forms-and-IndicatingAjaxSubmitButton---multiple-issues-to19190442.html

The fix in the follow js functions added dontTryToFindRootForm param where 
needed. Estentially fixing the fact that nested form dont have <form> tag and 
finding root form casues entire page form submission and url to change in 
browser

File wicket-ajax.js 

        // Submits a form using ajax.
        // This method serializes a form and sends it as POST body.
        submitForm: function(form, submitButton, dontTryToFindRootForm) {
            var body = function() {
                var s = Wicket.Form.serialize(form, dontTryToFindRootForm);
                if (submitButton != null) {
                        s += Wicket.Form.encode(submitButton) + "=1";
                    }
                    return s;               
            }
            return this.request.post(body);
        },
        
        // Submits a form using ajax
        submitFormById: function(formId, submitButton) {
                var form = Wicket.$(formId);
                if (form == null || typeof (form) == "undefined")
                        Wicket.Log.error("Trying to submit form with id 
'"+formId+"' that is not in document.");
                return this.submitForm(form, submitButton, 
form.tagName.toLowerCase() != "form");
        },


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to