-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I have a error message: "Only allowed to move within fitted timeslot" when i try move event to another date/hour in Calendar component.
thanks
After many hours of testing I found the problem and the solution...
The problem was fired if you have the time of date "incorrect". Timeslot=2: the minute must set 0 or 30 Timeslot=4: the minute must set 0 or 15 or 30 or 45 Timeslot=6: the minute must set 0 or 10 or 20 etc...etc..
I hope this help you Luca
I think is a bug
If you edit the event changing the date, after you can move without problems the event....
I post the example to reply the errror
the Calendar class ext
public class CalendarEventExt extends SimpleCalendarEvent
{ private static final long serialVersionUID = 1L;
int cod_cliente;
int cod_chiamata;
int cod_agente;
Boolean modificato=false;
.....
the class:
public class zzz extends SelectorComposer<Component>
{
private static final long serialVersionUID = 1L;
private SimpleCalendarModel scm = new SimpleCalendarModel();
@Wire("#zzz")
Window zzz;
@Wire("#calendar")
private Calendars calendar;
@SuppressWarnings({ "unchecked", "rawtypes" })
@AfterCompose
public void afterCompose(@ContextParam(ContextType.VIEW) Component view)
{
Selectors.wireComponents(view, this, false);
//
// Pulizia calendario
//
scm.clear();
calendar.setCurrentDate(java.util.Calendar.getInstance().getTime());
calendar.setFirstDayOfWeek(java.util.Calendar.getInstance().get(Calendar.DAY_OF_WEEK));
calendar.setBeginTime(8);
calendar.setEndTime(21);
java.util.Calendar cal = java.util.Calendar.getInstance();
CalendarEventExt sce=new CalendarEventExt();
sce.setBeginDate(cal.getTime());
cal.setTime(sce.getBeginDate());
cal.add(java.util.Calendar.HOUR, +1);
cal.add(java.util.Calendar.MINUTE, +30);
sce.setEndDate(cal.getTime());
sce.setTitle("Appuntamento 1");
sce.setContent("Indirizzo 1");
scm.add(sce);
CalendarEventExt sce2=new CalendarEventExt();
cal.setTime(sce.getBeginDate());
cal.add(java.util.Calendar.DAY_OF_MONTH, +1);
sce2.setBeginDate(cal.getTime());
cal.add(java.util.Calendar.HOUR, +1);
cal.add(java.util.Calendar.MINUTE, +30);
sce2.setEndDate(cal.getTime());
sce2.setTitle("Appuntamento 2");
sce2.setContent("Indirizzo 2");
scm.add(sce2);
calendar.setModel(scm);
calendar.invalidate();
calendar.addEventListener("onEventEdit", new EventListener()
{
public void onEvent(Event e) throws InterruptedException
{
//apriEdit((CalendarsEvent)e);
}
});
calendar.addEventListener("onEventUpdate", new EventListener()
{
public void onEvent(Event e) throws InterruptedException
{
//apriEdit((CalendarsEvent)e);
}
});
}
}
the zul:
<?page title="Gestione Agenda appuntamenti" contentType="text/html;charset=UTF-8"?>
<zk> <window id="Adm_agenda_visite" title="Gestione Agenda appuntamenti" border="normal" apply="org.zkoss.bind.BindComposer" viewmodel="@id('vm') @init('rvl.gm.ui.zzz')" validationmessages="@id('vmsgs')" closable="true">
<calendars id="calendar" height="500px" firstDayOfWeek="Sunday" mold="default" readonly="false" />
</window>
</zk>
thanks!! working really well!
Asked: 2014-11-05 14:17:03 +0800
Seen: 33 times
Last updated: Jan 20 '15
Calendar translation (german) for setWeekOfYear(true)
Can I dowload the ZK Calenda demo? [closed]
how to set today's date as default value in datebox?
How to add zCalendar events on startup through java code.
restrict user to Enter date into Datebox but can only Select...
Please, close the question. Thanks
lramellavotta ( 2014-11-30 17:16:37 +0800 )edit