Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8839567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:15:56+00:00 2026-06-14T10:15:56+00:00

I am fiddling with the schedule demo code from the primefaces showcase (using version

  • 0

I am fiddling with the schedule demo code from the primefaces showcase (using version 3.3.1), and I need to tweak some values of the scheduled itens on a move / resize event listener. ( I will be using “scheduled item” to mention the data model objects “the schedule’s events” and reserving the term “event” for the API triggered response on user interaction).

So whenever an user moves / resizes an scheduled item on the interface, the registered event listener fires, shows that day delta, minute delta message, as the showcase example would.

But I need to do some modifications on the item, namely:

a) make sure the scheduled item does not begin / end on a week-end day (also holiday, but lets ignore this). Move the beginning / end of the item back or forward to the previous work day (if it begins in a week-end) or into the next work day (if it ends in a week-end)

b) make the item snap to the closest quarter of hour.

c) make sure the scheduled item does not begin / end before 700 am or after 2100pm. snap begin / end hour to these limits if they are exceeded.

and display the resulting changes on the user interface. But I am not able to edit the data model during the event listener method.

Here is the schedule tag:

                    <p:schedule value="#{scheduleController.eventModel}"
                        widgetVar="myschedule" view="agendaWeek" allDaySlot="false"
                        slotMinutes="15" firstHour="7" showWeekends="FALSE"
                        leftHeaderTemplate="prev,next" rightHeaderTemplate=""
                        minTime="7am" maxTime="21pm" timeFormat="dd/MM H:mm{ - dd/MM H:mm}"
                        axisFormat="HH" timeZone="#{rotulo.timeZone}">

                        <p:ajax event="dateSelect"
                            listener="#{scheduleController.onDateSelect}"
                            update="eventDetails" oncomplete="eventDialog.show()" />
                        <p:ajax event="eventSelect"
                            listener="#{scheduleController.onEventSelect}"
                            update="eventDetails" oncomplete="eventDialog.show()" />
                        <p:ajax event="eventMove"
                            listener="#{scheduleController.onEventMove}" update="messages" />
                        <p:ajax event="eventResize"
                            listener="#{scheduleController.onEventResize}" update="messages" />

                    </p:schedule>

And the managed bean method…

    public void onEventMove(ScheduleEntryMoveEvent event) {  
        doBusinessLogic((DefaultScheduleEvent) event.getScheduleEvent());
        FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Event moved", "Day delta:" + event.getDayDelta() + ", Minute delta:" + event.getMinuteDelta());  

        addMessage(message);  
    }  

    public void onEventResize(ScheduleEntryResizeEvent event) {  
        doBusinessLogic((DefaultScheduleEvent) event.getScheduleEvent());
        FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Event resized", "Day delta:" + event.getDayDelta() + ", Minute delta:" + event.getMinuteDelta());  

        addMessage(message);  
}  

it is inside this doBusinessLogic() that I’ll tweak the time values.How can I get the changes done there to the DefaultScheduleEvent reflect on the data model of the schedule?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:15:57+00:00Added an answer on June 14, 2026 at 10:15 am

    The code is fine, and by debugging the data model, the business logic is really updating the schedule items correctly.

    The problem is in the view update. The update attribute of the p:ajax calls should be the entire form, not just the eventDetails or the messages.

    So by changing the jsf page to:

     <p:schedule value="#{scheduleController.eventModel}"
                            widgetVar="myschedule" view="agendaWeek" allDaySlot="false"
                            slotMinutes="15" firstHour="7" showWeekends="FALSE"
                            leftHeaderTemplate="prev,next" rightHeaderTemplate=""
                            minTime="7am" maxTime="21pm" timeFormat="dd/MM H:mm{ - dd/MM H:mm}"
                            axisFormat="HH" timeZone="#{rotulo.timeZone}">
    
                            <p:ajax event="dateSelect"
                                listener="#{scheduleController.onDateSelect}"
                                update="MYFORM" oncomplete="eventDialog.show()" />
                            <p:ajax event="eventSelect"
                                listener="#{scheduleController.onEventSelect}"
                                update="MYFORM" oncomplete="eventDialog.show()" />
                            <p:ajax event="eventMove"
                                listener="#{scheduleController.onEventMove}" update="MYFORM" />
                            <p:ajax event="eventResize"
                                listener="#{scheduleController.onEventResize}" update="MYFORM" />
    
                        </p:schedule>
    

    I was able to see the changes in the events on screen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From some brief fiddling about, I find I get an error when overriding superclass
Im doint some nodejs fiddling with blogposts from wordpress and geotagging of theese posts.
I'm fiddling with calling DLLs from C#, and came across the need to define
I am fiddling around with the following code. However, I need the file name
Whilst running test code from this question and fiddling with the JVM's thread stack
I'm fiddling around with a possible way to run some chunks of this stuff
I have been fiddling with code to call a function with the name of
I'm fiddling around with PostgreSQL right now. I can see the user indexes using
I have been fiddling with this issue all day now. I need to create
I'm fiddling around with the C/C++ version of Eclipse to build a simple GTK

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.