You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Ritesh Trivedi (JIRA)" <ji...@apache.org> on 2008/08/29 21:41:44 UTC

[jira] Created: (WICKET-1811) Nested Forms and *AjaxButton issue

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.


[jira] Assigned: (WICKET-1811) Nested Forms and *AjaxButton issue

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-1811:
-------------------------------------

    Assignee: Matej Knopp

> 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
>            Assignee: Matej Knopp
>
> 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.


[jira] Commented: (WICKET-1811) Nested Forms and *AjaxButton issue

Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627127#action_12627127 ] 

Matej Knopp commented on WICKET-1811:
-------------------------------------

Also, deploying the application and sending me the link *could* help. Doesn't have to because I might need to debug the stuff.

> 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
>            Assignee: Matej Knopp
>
> 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.


[jira] Commented: (WICKET-1811) Nested Forms and *AjaxButton issue

Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627126#action_12627126 ] 

Matej Knopp commented on WICKET-1811:
-------------------------------------

It should contain the minimal amount of stuff necessary to reproduce the problem. In your case probably simulated component hierarchy and some trigger that submits the form and shows the error. It shouldn't contain have any dependencies apart from standard wicket stuff. Your domain dependent stuff doesn't have to be involved at all as long as it's not vital to reproduce the problem.

> 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
>            Assignee: Matej Knopp
>
> 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.


[jira] Commented: (WICKET-1811) Nested Forms and *AjaxButton issue

Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627110#action_12627110 ] 

Matej Knopp commented on WICKET-1811:
-------------------------------------

This doesn't seem to be right. The idea is to submit the outer most form. It shouldn't cause whole page to be reloaded. I would really need a project to reproduce this. As far as I can tell problem is not submitting the entire form (it is meant to be like that and there are good reasons for it). Problem in your case is the page reload. That shouldn't be happening.

> 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
>            Assignee: Matej Knopp
>
> 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.


[jira] Resolved: (WICKET-1811) Nested Forms and *AjaxButton issue

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-1811.
-----------------------------------

    Resolution: Cannot Reproduce

please reopen with a quickstart. http://wicket.apache.org/start/quickstart.html

> 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
>            Assignee: Matej Knopp
>
> 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.


[jira] Commented: (WICKET-1811) Nested Forms and *AjaxButton issue

Posted by "Ritesh Trivedi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627112#action_12627112 ] 

Ritesh Trivedi commented on WICKET-1811:
----------------------------------------

Thanks for the quick response.

Not sure what should be included in the project? does it mean I have to extract out domain dependent stuff and use mock objects etc? that sounds bit more complicated - hope there is a better way.

Will it help if I deploy the application on one of my servers and send you the URL?

> 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
>            Assignee: Matej Knopp
>
> 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.