CommandButton: on click event added manually in JS doesn't work in PF 12
See original GitHub issueDescribe the bug
I put below two problems in one issue, because I think that they may be connected.
- In CommandButton on click event added manually in JS doesn’t work. Problem doesn’t exist in PF 11. I reproduced it in PF 12.0.0-RC2.
I have code:
<script>
jQuery(document).on('click', 'button', function() {
alert('test');
});
</script>
<h:form>
<p:commandButton action="back" value="Back" />
</h:form>
- What’s more - I don’t have enabled option
disableOnAjax="true"
norinlineAjaxStatus="true"
(added in PF 12 #8301), but when I run below code
<script>
window.onbeforeunload = function() {
return "Your data will be lost.";
};
</script>
<h:form>
<p:commandButton action="back" value="Back" />
</h:form>
My button changes from:
to
I don’t want this spinner/loading to show on my button when I don’t add any of the option from #8301.
Reproducer
No response
Expected behavior
No response
PrimeFaces edition
Community
PrimeFaces version
12.0.0-RC2
Theme
No response
JSF implementation
Mojarra
JSF version
2.2
Browser(s)
Chrome 103
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
commandButton/commandLink/ajax action/listener method not ...
Introduction. Whenever an UICommand component ( <h:commandXxx> , <p:commandXxx> , etc) fails to invoke the associated action method, or an UIInput component ...
Read more >CommandButton: add inline Ajax status indicator #8301 - GitHub
CommandButton : on click event added manually in JS doesn't work in PF ... inline progress-indicator when execution action using PF 12 #9296....
Read more >Command button won't call javascript - Salesforce Developers
Hi All,. I'm having a problem with my visual force page whereby i'm simply trying to get a command button to call a...
Read more >USER GUIDE 6.2 - PrimeFaces
PrimeFaces is an open source JSF component suite with various extensions. • Rich set of components (HtmlEditor, Dialog, AutoComplete, Charts and many more)....
Read more >Apex Tutorials - Salesforce coding lessons for the 99%
Calling Apex from a button; Scheduling Apex jobs in a batch ... and the lamest javascript framework ever (Lightning), is NOT a real...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
☝🏻 https://primefaces.github.io/primefaces/12_0_0/#/core/globalattributes
It seems impossible due to the disabled state. Some tests: