getting null on @Listen("onEventEdit = #calendars") event SelectorComposer<Component> on clustered environment

asked 2015-04-10 08:37:26 +0800

Aasifi gravatar image Aasifi
15 3

updated 2015-04-22 14:01:01 +0800

Hello Everyone,

I have two tomcats deployed at my machine and using clustered environment for my application.I am using zk calendar at in my application.I am using SelectorComposer<component> for listing events and for Create/Edit of events I am calling my own custom jsp files.Everything works fine when application is deployed only on one tomcat but for clustering on clicking of edit of event I am getting an alert mentioning "null" only.It works fine for create event.I am unable to get the issue as it is displaying only "null" in alert.

My zul file looks like

<zk> <style src="/widgets/zk_calendar/zk_calendar/style.css"/> <window id="displayMyEntry">

<hlayout sclass="z-valign-middle"> <button id="today" label="${labels.Today}"/> <button id="prev" image="../img/arrow-180.png"/> <button id="next" image="../img/arrow.png"/> <separator width="50px"/> <button id="pageDay" label="${labels.Day}" width="55px"/> <button id="pageWeek" label="${labels.Week}" width="55px"/> <button id="pageMonth" label="${labels.Month}" width="55px"/> <separator width="50px"/> ${labels.Filter} : <textbox id="filter"/> <button id="applyFilter" label="${labels.Apply}"/> <button id="resetFilter" label="${labels.Reset}"/> </hlayout> <separator bar="true" height="20px"/>

        <calendars id="calendars" firstDayOfWeek="Sunday" height="600px" 
            <toolbar sclass="calendar-toolbar">
                <div class="float-left">



Also my CalendarController.java is

public class CalendarController extends SelectorComposer<component> implements Serializable { private static final long serialVersionUID = 1L; DateFormat formatter; int key = 0; public HashMap eventMap = new HashMap();

private Calendars calendars;
private Textbox filter;

private CalendarModel calendarModel;

//the in editing calendar ui event
private CalendarsEvent calendarsEvent = null;

public void doAfterCompose(Component comp) throws Exception {
    calendarModel = new CalendarModel(new CalendarData().getCalendarEvents());

@Listen("onEventCreate = #calendars")
public void createEvent(CalendarsEvent event) {
    System.out.println("onEventCreate :::"+event.getName());
    formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");

    String stDate = "";
    String endDate = "";
    if (event != null)
        stDate = formatter.format(event.getBeginDate());
        endDate = formatter.format(event.getEndDate());
    String uri = "createEvent.jsp?startDate=" + stDate + "&endDate=" + endDate; 
    try {
        java.net.URLEncoder.encode(uri, "UTF-8");
    } catch (UnsupportedEncodingException e) {


    Executions.getCurrent().sendRedirect(uri, "_parent");

/* Unable to call this method when used in clustering*/
@Listen("onEventEdit = #calendars")
public void editEvent(CalendarsEvent event) {
        try {
    org.zkoss.calendar.Calendars cal = (org.zkoss.calendar.Calendars) event.getTarget();
    SimpleCalendarModel m = (SimpleCalendarModel) cal.getModel();
    SimpleCalendarEvent sce = (SimpleCalendarEvent) event.getCalendarEvent();
    int index = m.indexOf(sce);

    eventMap = (HashMap)Sessions.getCurrent().getAttribute("eventMap");
    int eventid = Integer.parseInt(eventMap.get(index).toString());
    String uri = "e_event.jsp?eventid="+eventid;

        java.net.URLEncoder.encode(uri, "UTF-8");
        Executions.getCurrent().sendRedirect(uri, "_parent");
        } catch (UnsupportedEncodingException e) {


@Listen("onEventUpdate = #calendars")
public void updateEvent(CalendarsEvent event) {
    CalendarEvents data = (CalendarEvents) event.getCalendarEvent();


Please help me out.Any help would be highly appreciated. Regards, Aasif Iqbal

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2015-04-10 08:37:26 +0800

Seen: 19 times

Last updated: Apr 22 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More