I am using PrimeFaces Schedule. I have noticed that after you select a slot
"save" button can be clicked multiple times, depends on how fast you can click. I did it 5 times before dialog disappeared.
Please find below the code snippet copied from the same link:
<p:dialog widgetVar="eventDialog" header="Event Details" showEffect="clip" hideEffect="clip">
<h:panelGrid id="eventDetails" columns="2">
<p:outputLabel for="title" value="Titles:" />
<p:inputText id="title" value="#{scheduleView.event.title}" required="true" />
<p:outputLabel for="from" value="From:" />
<p:calendar id="from" value="#{scheduleView.event.startDate}" timeZone="GMT+2" pattern="dd/MM/yyyy HH:mm"/>
<p:outputLabel for="to" value="To:" />
<p:calendar id="to" value="#{scheduleView.event.endDate}" timeZone="GMT+2" pattern="dd/MM/yyyy HH:mm"/>
<p:outputLabel for="allDay" value="All Day:" />
<h:selectBooleanCheckbox id="allDay" value="#{scheduleView.event.allDay}" />
<p:commandButton type="reset" value="Reset" />
<p:commandButton id="addButton" value="Save" actionListener="#{scheduleView.addEvent}" oncomplete="PF('myschedule').update();PF('eventDialog').hide();" />
</h:panelGrid>
</p:dialog>
Problem is how to restrict number of request to 1 per dialog box.
Thanks