I'm using HTML and JSF Primefaces, for this part of the System, PrimeFaces are not enabled (don't know why), the matter is:
I have a button
<h:commandButton id="btnPrint"
onclick = "switchDisabled();"
actionListener="#{componentTrackingController.printReport()}"
value="Print Report"
/>
onClick its executing and working well (it just disables some other buttons) but actionListener is not. The fact is that when I delete the "onClick" line, actionsListener works fine.
My JavaScript Code is simple (but I think the problem is not here)
<script type="text/javascript">
function switchDisabled(){
askDisabled(document.getElementById('mainForm:cboURdependences'));
askDisabled(document.getElementById('mainForm:btnPrint'));
askDisabled(document.getElementById('mainForm:btnCloseReport'));
}
function askDisabled(elem){
if (elem.disabled != true){
elem.disabled = true;
}else{
elem.disabled = false;
}
}
</script>