Wicket-ajax.js: Javascript error on submitting of form with
wicketSubmitFormById.
---------------------------------------------------------------------------------
Key: WICKET-2553
URL: https://issues.apache.org/jira/browse/WICKET-2553
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.4.3, 1.4.2
Reporter: Daan
In SVN revision 815602
(http://www.mail-archive.com/[email protected]/msg13879.html) some new
code is added.
This introduces a new bug where a null button is added to the form. This gives
an error in Safari and Firefox and results in a form that doesn't submit.
{code}
if (submitButton!=null) {
try {
var btn = document.createElement("<input type='hidden'
name='"+submitButton+"' id='"+iframe.id+"-btn' value='1'/>");
} catch (ex) {
var btn = document.createElement("input");
btn.type="hidden";
btn.name=submitButton;
btn.id=iframe.id+"-btn";
btn.value="1";
}
}
form.appendChild(btn);
{code}
In the code above, form.appendChild(btn) is called. In my case, the btn is not
created yet, because the "if" statement is skipped (submitButton == null).
This results in an error.
I think the form.appendChild(btn) line needs to be inside the "if" block, so it
is not called when the btn does not exist.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.