jsf 2 - How to cancel a resize o drag event on Primefaces Schedule -
i have primefaces schedule component:
<h:form> <p:growl id="messages" showdetail="true" /> <h:panelgrid columnclasses="value"> <h3>lazy schedule</h3> <p:schedule value="#{visorbean.eventmodel}" timeformat="h:mm" draggable="true" firsthour="8" mintime="8:00" maxtime="22:00" resizable="true" axisformat="h:mm" view="agendaweek"> <p:ajax event="eventmove" listener="#{viwerbean.oneventmove}" update="messages" /> <p:ajax event="eventresize" listener="#{viwerbean.oneventresize}" update="messages" /> </p:schedule> </h:panelgrid> </h:form>
and backing bean:
public void oneventmove(scheduleentryresizeevent event) { string msg; if(iseventvalid(event)) { msg = "ok!"; } else { msg = "ops!"; revertfunction(); // undo change } facesmessage message = new facesmessage(facesmessage.severity_info, "event resized", msg); addmessage(message); }
how can undo changes when event not allowed (for instance, event must start after 8.00 am)?
Comments
Post a Comment