Hi,
I want to display the certain month to be displayed for a certain event. Is this possible?
Thanks Tai
how to focus on event schedule?
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
You can use the initialDate attribute.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
You can bind any date to initialDate;
Code: Select all
<p:schedule initialDate="#{bean.date}" .../>
Yes. Understood. But I assume this attribute is set only once, correct? But I want this programmatically set in my class (and not in my xhtml). This allows me to set the schedule's inital date every time when a new event is added.
Currently when I update the view then the schedule always jumps to "now". Maybe when setting the inital date is set on a refresh it always jumps the this date. But I want to set the inital date to the latest event.
Currently when I update the view then the schedule always jumps to "now". Maybe when setting the inital date is set on a refresh it always jumps the this date. But I want to set the inital date to the latest event.
I tried the following to remember the last event select by using the attribute eventSelectListener="#{productionScheduleBean.onEventSelect}":
Unfortunately that doesn't work. On a refresh the schedule still jumps to "now".
Code: Select all
public void onEventSelect(ScheduleEntrySelectEvent selectEvent) {
....
Schedule schedule = (Schedule) selectEvent.getSource();
schedule.setInitialDate(productionRun.getProductionStart());
FacesContext.getCurrentInstance().renderResponse();
}
}
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Do you refresh the whole page, initialDate only works when page is refreshed, for ajax it would not work.
Programmatical update of the initial date is too complicated. Since the schedule handling e.g. in the onEventSelect() contains an old schedule (I assume Schedule is new created when rendering is done):
Schedule schedule = (Schedule) selectEvent.getSource(); //returns an old schedule
The easiest way is really to use the attribute in the facelet:
initialDate="#{productionScheduleBean.currentProductionStart}"
That Works for me.
Thanks Tai
Schedule schedule = (Schedule) selectEvent.getSource(); //returns an old schedule
The easiest way is really to use the attribute in the facelet:
initialDate="#{productionScheduleBean.currentProductionStart}"
That Works for me.
Thanks Tai
-
- Posts: 1
- Joined: 02 Jan 2017, 10:25
How can I highlight the initialDate on monthview?
-
- Information
-
Who is online
Users browsing this forum: No registered users and 37 guests