Theme
CommandButtonSingleClick

This renderer for CommandButtons will disable the button while an Ajax action is being processed.

To enable this renderer, in the faces-config.xml, in the <render-kit>...</render-kit> section, add:

<renderer>
    <component-family>org.primefaces.component</component-family>
    <renderer-type>org.primefaces.component.CommandButtonRenderer</renderer-type>
    <renderer-class>org.primefaces.extensions.renderer.CommandButtonSingleClickRenderer</renderer-class>
</renderer>

Demo:

Press to render button B:
Press to render button A:
Components and more
PrimeFaces Extensions Showcase - © 2011-2021,PrimeFaces: 10.0.0,PrimeFaces Extensions: 10.0.5,JSF: Apache MyFaces JSF-2.3 Core API 2.3.9,Server: jetty/9.4.36.v20210114,Build time: 2021-08-28 16:46
occured!