My code:
<h:form id="newBSTypePanel" >
<h:panelGrid columns="2" id="newRecod" >
<h:outputText value="Name"/><h:inputText value="#{treeTableController.newBStypeBean.currentObject.TYPENAME.value}" required="true" />
<p:commandButton value="save" action="#{treeTableController.saveNewNodes}" oncomplete="Dlg.hide()" update="productDataForm"/>
<p:commandButton value="close" oncomplete="Dlg.hide()" />
</h:panelGrid>
</h:form>
There is quite a bit of functionality associated with the save action. If I click the button repeatedly, it may save a few records in the database. That’s not my wish. How can I prevent multiple clicks and resolve this?
The
<p:commandButton>‘s Client Side API Widget:PrimeFaces.widget.CommandButtonMethod Params Return Type Description
disable()– void Disables buttonenable()– void Enables buttonSo you can just use like this: