title: How to avoid repeatedly click a button in a form?
body: <p>My code:</p>
  
  <pre><code>&lt;h:form id="newBSTypePanel" &gt;
      &lt;h:panelGrid columns="2" id="newRecod" &gt;
          &lt;h:outputText value="Name"/&gt;&lt;h:inputText value="#{treeTableController.newBStypeBean.currentObject.TYPENAME.value}" required="true" /&gt;
          &lt;p:commandButton value="save" action="#{treeTableController.saveNewNodes}" oncomplete="Dlg.hide()" update="productDataForm"/&gt;
          &lt;p:commandButton value="close" oncomplete="Dlg.hide()" /&gt;
      &lt;/h:panelGrid&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>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?</p>