p:schedule update lazy data only

UI Components for JSF
Post Reply
piogwi
Posts: 19
Joined: 29 Aug 2011, 08:31

07 Sep 2011, 16:10

Is it possible to update current schedule view with new events without reloading schedule component?

My case:

1. I have some event filters (assigned users, type etc.)
2. I select event type : Meeting
3. In my schedule view I change from week to month view and go two months ahead.
4. Then I change event type filter and hit "Search" button
5. After update my schedule is back on today and week view.

I use lazy loading.

My schedule

Code: Select all

                       <p:schedule id="schedule"
                                    value="#{eventsIndexView.scheduleModel}"
                                    view="agendaWeek"
                                    allDaySlot="true"
                                    slotMinutes="30"
                                    editable="false"
                                    draggable="false"
                                    resizable="false"
                                    >
                        </p:schedule>
and my search button

Code: Select all

                    <p:commandButton value="Search" action="#{eventsIndexView.doSearch}" 
                                     update="schedule" />
I'd like to see other events in time span and view mode selected before hitting search button.

I've tried to update whole form containing button and schedule and setting ajax=false to the button. Neither of theese helped.

maszub
Posts: 3
Joined: 07 Sep 2011, 14:45

09 Sep 2011, 16:21

Hello,
try to put schedule view into schedule controler varaible like this

view="#{scheduleController.scheduleView}"

with this solution u must create your own button to change scheduleView but the compoennt state is always save.
U should turn off buttons from schedule compoent too.

Regards
Maciej

ifloor
Posts: 5
Joined: 31 Aug 2013, 06:38

02 Sep 2013, 22:47

Hi, sorry for posting in a post old like this one, but in the same way I got here today searching in google, others can too.

The problem is if you update the schedule through ajax update, it makes a new request and clean the state of the schedule, and information about current date, current view of the schedule among others are lost.
The solution is to call the method update() of the component through javascript(using the widget name of the schedule)

Example:

Code: Select all

scheduleWidgetName.update();
I hope this helps someone!

Thanks,
Igor

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests