public void onEventCreate(CalendarsEvent event) throws InterruptedException, RemoteException {
   StorageComponentProxy proxy = SystemDictionary.getSCProxy();
   bookEventWin = (Window) Executions.createComponents("bookEvent.zul", self.getParent(), null);
   bookEventWin.setAttribute("calendars", cal);
   bookEventWin.setAttribute("calevent", event);
   bookEventWin.getFellow("qsrow").setVisible(true);
   Date setting = event.getBeginDate();
   setting.setTime(setting.getTime() + 43200000);
   ((Datebox) bookEventWin.getFellow("datetask")).setValue(setting);
   ((Timebox) bookEventWin.getFellow("timetask")).setValue(setting);
   ((Button) bookEventWin.getFellow("savebutton")).setVisible(true);
   ((Listbox) bookEventWin.getFellow("tasktypesel")).setSelectedIndex(0);
   String userid = (String) Sessions.getCurrent().getAttribute("userid");
   ((Textbox) bookEventWin.getFellow("userid")).setValue(userid);
   Toolbar toolbar = (Toolbar) self.getFellow("toolbar");
   String currentexecutor = ((Label) toolbar.getFellow("exechelp")).getValue();
   SystemDictionary.webguiLog("DEBUG", "Executor: " + currentexecutor);
   OperationResult opres =
       proxy.getUserIdByPersonId(currentexecutor, SystemDictionary.USERTYPE_PATIENT_INT, userid);
   Patient patient = proxy.getPatient(currentexecutor, userid);
   Carer carer = patient.getPatientCarer();
   OperationResult realexecutor =
       proxy.getUserIdByPersonId(carer.getID(), SystemDictionary.USERTYPE_CARER_INT, userid);
   SystemDictionary.webguiLog(
       "DEBUG", "Executor req: " + realexecutor.getCode() + ":" + opres.getDescription());
   ((Textbox) bookEventWin.getFellow("objid")).setValue(realexecutor.getCode());
   ((Textbox) bookEventWin.getFellow("addressedid")).setValue(opres.getCode());
   ((Textbox) bookEventWin.getFellow("objstr")).setValue(carer.toString());
   ((Textbox) bookEventWin.getFellow("addressedstr")).setValue(patient.toString());
   User assigner = proxy.getUser(userid);
   Clinician assg = proxy.getClinician(assigner.getPersonID(), userid);
   ((Textbox) bookEventWin.getFellow("userstr")).setValue(assg.toString());
   ((Listbox) bookEventWin.getFellow("questnamefield")).setSelectedIndex(0);
   // bookEventWin.getFellow("assignerrow").setVisible(false);
   bookEventWin.getFellow("massivequestionrow").setVisible(true);
   bookEventWin.getFellow("massivecheckrow").setVisible(true);
   bookEventWin.setTitle("New Task");
   bookEventWin.setVisible(true);
   bookEventWin.doModal();
 }
  /** Creates the components..<br> */
  private void createComponents() {

    /**
     * !! Windows as NameSpaceContainer to prevent not unique id's error from other dashboard module
     * buttons or other used components.
     */
    Window win = new Window();
    win.setBorder("none");
    win.setParent(this);

    Groupbox gb = new Groupbox();
    gb.setMold("3d");
    gb.setClosable(false);
    gb.setParent(win);
    Caption cap = new Caption();
    cap.setImage("/images/icons/new_icons_10.gif");
    cap.setLabel(Labels.getLabel("common.Application.History"));
    cap.setStyle("padding: 0px;");
    cap.setParent(gb);

    // Buttons Toolbar/Timer
    Div div = new Div();
    div.setSclass("z-toolbar");
    div.setStyle("padding: 0px");
    div.setParent(cap);
    Hbox hbox = new Hbox();
    hbox.setPack("stretch");
    hbox.setSclass("hboxRemoveWhiteStrips");
    hbox.setWidth("100%");
    hbox.setParent(div);
    Toolbar toolbarRight = new Toolbar();
    toolbarRight.setAlign("end");
    toolbarRight.setStyle("float:right; border-style: none;");
    toolbarRight.setParent(hbox);

    Hbox hboxBtn = new Hbox();
    hboxBtn.setSclass("hboxRemoveWhiteStrips");
    hboxBtn.setWidth("100%");
    hboxBtn.setParent(toolbarRight);

    //		Paging paging = new Paging();
    //		paging.setParent(hboxBtn);
    //		paging.setDetailed(true);

    if (isTimerControl()) {
      Button btnTimer = new Button();
      btnTimer.setId("btnTimer");
      btnTimer.setHeight("22px");
      btnTimer.setImage("/images/icons/clock1_16x16.gif");

      // convert to seconds
      int seconds = (int) Math.round(getDelay() / 1000);

      if (seconds > 60) {
        // convert to minutes and set localization to minutes
        int minutes = (int) Math.round((getDelay() / 1000) / 60);
        btnTimer.setTooltiptext(
            Labels.getLabel("btnTimer.tooltiptext")
                + " "
                + minutes
                + " "
                + Labels.getLabel("common.Minutes"));
      } else
        // set localization to seconds
        btnTimer.setTooltiptext(
            Labels.getLabel("btnTimer.tooltiptext")
                + " "
                + seconds
                + " "
                + Labels.getLabel("common.Seconds"));

      btnTimer.addEventListener("onClick", new BtnClickListener());
      btnTimer.setParent(hboxBtn);
    }

    Button btnRefresh = new Button();
    btnRefresh.setId("btnRefresh");
    btnRefresh.setHeight("22px");
    btnRefresh.setLabel("!");
    btnRefresh.setTooltiptext(Labels.getLabel("btnRefresh.tooltiptext"));
    btnRefresh.addEventListener("onClick", new BtnClickListener());
    btnRefresh.setParent(hboxBtn);
    // END Buttons Toolbar/Timer

    // body
    Borderlayout bl = new Borderlayout();
    bl.setHeight(getModulHeight() + "px");
    bl.setParent(gb);
    Center ct = new Center();
    ct.setSclass("FDCenterNoBorder");
    ct.setStyle("background-color: white");
    ct.setFlex(true);
    ct.setParent(bl);

    // Listbox
    listbox = new Listbox();
    listbox.setStyle("border: none;");
    listbox.setHeight("100%");
    listbox.setVisible(true);
    listbox.setParent(ct);
    listbox.setItemRenderer(new ItemRenderer());

    Listhead listhead = new Listhead();
    listhead.setParent(listbox);

    Listheader listheader1 = new Listheader();
    listheader1.setWidth("100px");
    listheader1.setHeight("0px");
    listheader1.setParent(listhead);

    Listheader listheader2 = new Listheader();
    listheader2.setWidth("100%");
    listheader1.setHeight("0px");
    listheader2.setParent(listhead);

    doReadData();
  }