Author: maksimkaszynski
Date: 2007-11-30 09:53:56 -0500 (Fri, 30 Nov 2007)
New Revision: 4392
Modified:
branches/3.1.x/framework/impl/src/main/resources/org/ajax4jsf/javascript/scripts/form.js
Log:
http://jira.jboss.com/jira/browse/RF-1355
backported to 3.1.x branch
Modified:
branches/3.1.x/framework/impl/src/main/resources/org/ajax4jsf/javascript/scripts/form.js
===================================================================
---
branches/3.1.x/framework/impl/src/main/resources/org/ajax4jsf/javascript/scripts/form.js 2007-11-30
14:53:50 UTC (rev 4391)
+++
branches/3.1.x/framework/impl/src/main/resources/org/ajax4jsf/javascript/scripts/form.js 2007-11-30
14:53:56 UTC (rev 4392)
@@ -6,21 +6,14 @@
function _JSFFormSubmit(linkId,formName,target,parameters){
var form = document.getElementById(formName);
if(form){
- var hiddenField = form.elements[formName+":_idcl"];
- if(hiddenField){
- hiddenField.value=linkId;
- } else {
- var input = document.createElement("input");
- input.type="hidden";
- input.name=formName+":_idcl";
- input.value=linkId;
- form.appendChild(input);
- }
+ var paramNames = [];
+
if(target){
form.target=target;
}
if(parameters){
for(var param in parameters){
+ paramNames.push(param);
if(form.elements[param]){
form.elements[param].value = parameters[param];
} else {
@@ -33,6 +26,8 @@
}
}
form.submit();
+ _clearJSFFormParameters(formName,target,paramNames);
+
} else {
alert("Form "+formName+" not found in document");
}