Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Calendar Events not getting displayed on desired place

    URGENT ISSUE

    I have a Calendar Object bound to my simple Datasource and I try to fetch data manually using fetchData(). I get the records as desired and now I try to set the same details in a CalendarEvent object and than assign the same CalendarEvent obj to CalendarEvent array. After all this If I trace the CalendarEvent array all values are all correct. But while displaying the same, the calendarEvent does not display on its desired o/p.

    I am adding my code for more reference

    Code:
    Criteria criteria = new Criteria(); 
        criteria.addCriteria("truckId", "10");
    
        calendar.setShowDayView(false);
        calendar.setShowMonthView(false);
        calendar.setShowWeekView(true);
        calendar.setRowHeight(40);
        calendar.setDisableWeekends(false);
        calendar.setTimeFormatter(TimeFormatter.TOSHORT24HOURTIME);
        calendar.setDataSource(DataSource.get(LOAD_DMI));  
        calendar.invalidateCache();
    
        calendar.fetchData(criteria, new DSCallback() 
        {
            @Override
            public void execute(DSResponse response, Object rawData, DSRequest request) 
            {
                try
                {
                    Record[] recordList = response.getData();
                    record = new CalendarEvent();                   
                    int temp = 1;
                    calendarEvnt = new CalendarEvent[recordList.length];
                    for(int k=0; k<recordList.length; k++)
                    {
                        record.setEventId(temp);
                        record.setName(recordList[k].getAttribute("customerName"));
                        record.setDescription(recordList[k].getAttribute("truckName"));
                        record.setStartDate(recordList[k].getAttributeAsDate("scheduledPickUpDateAndTime"));
                        record.setEndDate(recordList[k].getAttributeAsDate("scheduledDropOffDateAndTime"));
    
                        calendarEvnt[k] = new CalendarEvent(record.getEventId(), record.getName(), record.getDescription(), record.getStartDate(), record.getEndDate());
    
                        temp++;
                    }
                    System.out.println("CALENDER EVENT Size ::: "+calendarEvnt.length);
                    calendar.setData(calendarEvnt);
                }
                catch(Exception e)
                {
                    e.printStackTrace();
                }
            }
        });
        calendar.draw();
    o/p :

    EVENT ID ::: 1 :: START DATE :: Mon Mar 11 16:30:00 IST 2013 :: END DATE :: Mon Mar 11 19:00:00 IST 2013

    EVENT ID ::: 2 :: START DATE :: Mon Mar 11 20:00:00 IST 2013 :: END DATE :: Mon Mar 11 23:06:00 IST 2013

    Plz have a look on o/p images as attached
    Attached Files
Working...
X