Details
Description
For <f:ajax> with disabled=true inside of a <h:commandButton> with an onclick function, MyFaces renders return=false after an unnecessary jsf.util.chain() call in the rendered <input> onclick, effectively preventing form submission. Consider the following simple commandButton
<h:commandButton id="button1" value="AjaxTest" action="index" onclick="alert('test')">
<f:ajax disabled="true" />
</h:commandButton>
This will render as follows:
<input id="form1:button1" name="form1:button1" type="submit" value="AjaxTest" onclick="jsf.util.chain(document.getElementById('form1:button1'), event,'alert(\'test\');'); return false;">
Clicking the button will neither trigger an ajax request, which it shouldn't, nor trigger a form submit, which it should.
Removing the <f:ajax> tag entirely renders the following functional submit button:
<input id="form1:button1" name="form1:button1" type="submit" value="AjaxTest" onclick="var cf = function()
;var oamSF = function(){};return (cf.apply(this, [])==false)? false : oamSF.apply(this, []); ">