Board index JavaServer Faces General Editable schedule - problem with hours

Editable schedule - problem with hours

Components, Ajax Framework, Utilities and More.


Posts: 2
Hi there

My problem is about basic schedule functionality which is adding events. I'd like to set start hour and end hour for each non all-day event, thus I have:

   <p:schedule value="#{scheduleController.eventModel}" editable="true"
                 widgetVar="myschedule"
                eventSelectListener="#{scheduleController.onEventSelect}"
                dateSelectListener="#{scheduleController.onDateSelect}"
      onEventSelectUpdate="eventDetails" onEventSelectComplete="eventDialog.show()"
      onDateSelectUpdate="eventDetails" onDateSelectComplete="eventDialog.show()" />         

               <p:dialog id="dialog" widgetVar="eventDialog" header="Event"
               showEffect="clip" hideEffect="clip">
               <h:panelGrid id="eventDetails" columns="2">
               
               <h:outputLabel for="title" value="Name" />
               <h:inputText id="title" value="#{scheduleController.event.title}" required="true"/>
            
               <h:outputLabel id="idStart" value="#{dialogBean.meetingStart}:" />
               <p:inputMask id="from" value="#{scheduleController.event.startDate}" mask="99/99/9999 99:99" >
               <f:convertDateTime pattern="dd/MM/yyyy HH:mm" timeZone="#{scheduleController.timezone}" />
               </p:inputMask>

               <h:outputLabel id="idEnd" value="#{dialogBean.meetingEnd}:" />
               <p:inputMask id="idEndInput" value="#{scheduleController.event.endDate}" mask="99/99/9999 99:99"  disabled="#{dialogBean.disabled}">
               <f:convertDateTime pattern="dd/MM/yyyy 23:59" timeZone="#{scheduleController.timezone}" />
               </p:inputMask>

               <h:outputLabel id="allDayLabel" value="All day"/>
               <h:selectBooleanCheckbox id="allDayCb" >
                  <p:ajax update="eventDetails" listener="#{dialogBean.updateHours}" />
               </h:selectBooleanCheckbox>
   
               <p:commandButton value="Save" actionListener="#{scheduleController.addEvent}"
               oncomplete="myschedule.update();eventDialog.hide();" />
               </h:panelGrid>
               </p:dialog>

(updateHours does nothing but disables date/hour input fields)

if event is created from day view, start hour is properly set to the hour I clicked, but after Save the event is registered under all day events at the top of the day. When opened to edit, the hour is also remembered correctly, only it's not displayed under corresponding hour but as all day event... Also while adding event from month view, if I set hours manually, they are not remembered at all...
Any ideas would be greatly appreciated.


Posts: 1
Try create the event with the FALSE full-day argument (argument #4)... something like this:

                eventModel.addEvent(new DefaultScheduleEvent("Champions League Match", previousDay8Pm(), previousDay11Pm(), false));


Posts: 2
Thanks for your hint, unfortunately it doesn't seem to have any effect - when I change start hour in existing event, save and reopen it, start hour is the same as end hour. I cannot find any corresponding example for schedule with hour input fields so I'm kinda short of ideas..


Return to General