Revision history [back]

click to hide/show revision 1
initial version

answered 2013-11-20 08:23:00 +0800

chillworld gravatar image chillworld flag of Belgium

https://github.com/chillw...

First of all, do you use MVC or MVVM?

In(MVC) your controller you extend SelectorComposer<component>, so override the following and put your events tehere in your calendar.

@Override    
public final void doAfterCompose(Component comp) throws Exception {
}

Greetz Chill.

First of all, do you use MVC or MVVM?

In(MVC) your controller you extend SelectorComposer<component>, so override the following and put your events tehere there in your calendar.

@Override    
public final void doAfterCompose(Component comp) throws Exception {
}

Greetz Chill.

First of all, do you use MVC or MVVM?

In(MVC) your controller you extend SelectorComposer<component>, so override the following and put your events there in your calendar.

@Override    
public final void doAfterCompose(Component comp) throws Exception {
}

This is from an previous project of me in mvc :

 /**
  * After composing the page, the calendar and customerlist are initialised.
  * In the calendar we put a model calendarModel with all the values of the
  * deliveries that are already plannified. The two list are initialised with
  * deliveries that has to be planified and the deliveries that are marked as
  * selfservice.
  *
  * @param comp initial component
  * @throws Exception can throw an exception
  */
@Override
public final void doAfterCompose(Component comp) throws Exception {
     super.doAfterCompose(comp);
     initCalendarModel();
     calendars.setModel(calendarModel);
     initCustomerList();
     calendars.setContext(deletePopup);
     initPopupMenu();
 } 


 /**
  * initiate the model of the calendar.
  */    
private void initCalendarModel() {         
    calendarModel = new SimpleCalendarModel();         
    Calendar cal = Calendar.getInstance();         
    cal.setTime(new Date());         
    addEventsMonth(cal.getTime());         
    cal.add(Calendar.MONTH, 1);         
    addEventsMonth(cal.getTime());         
    cal.add(Calendar.MONTH, -2);         
    addEventsMonth(cal.getTime());       
} 

/**
  * creates the content of the calendar event.
  *
  * @param beginDate date of the event
  */
private void addEventsMonth(Date beginDate) {
     for (Delivery delivery : deliveryService.getDeliveryPlanningForMonth(beginDate)) {
         CalendarEvent ce = PlanningUtil.createEvent(delivery);
         calendarModel.add(ce);
     }
 }

I hope this helps you.

Greetz Chill.

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