Announcement

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

    calendar widget

    I have the following questions related to calendar widget.

    1. Exception while adding a RecordList in a calendar.

    Record record = new Record();
    record.setAttribute("startDate", start);
    record.setAttribute("endDate", end);
    record.setAttribute("name", m_desc);
    record.setAttribute("description", m_address);
    record.setAttribute("canEdit", true);
    record.setAttribute("eventWindowStyle", m_stylevalue);
    rl.add(record);
    m_calendar.setData(rl);
    it throws an error when trying to delete an existing event. Please review the attached file.

    2. Exception while adding a Map in a calendar addEvent method.
    The issue is related to the calendar.addEvent (java.util.Date startDate, java.util.Date endDate, java.lang.String name, java.lang.String description, java.util.Map otherFields).

    I have created one map and put in the calendar.addEvent and then it throws a ClassCastException.
    Map map = New Hashmap()
    map.put(“Type”,”name”);
    calendar.addEvent(StartDate,EndDate,name,description,map);
    This will throw the java.lang.ClassCastException.

    3.Can not remove an existing event
    When trying to edit the existing event, it is not getting deleted and it will add new event along with the existing event.

    CalendarEvent ev = new CalendarEvent();
    ev.setDescription("description");
    ev.setName(”Name”);
    ev.setStartDate(startDate);
    ev.setEndDate(endDate);

    m_calendar.addEvent(ev.getStartDate(), ev.getEndDate(), ”Name” ,"description");

    m_calendar.removeEvent(ev);
    Attached Files

    #2
    Sorry about the confusion - the Calendar does not fully support editing events based on a RecordList data model (the setData() signature is overly broad in what it accepts for parity with other DataBoundComponents, which do support this mode).

    So rather than your current approach, we'd recommend using a client-only DataSource if you want a Calendar that edits in-memory data. Be sure to specify a primaryKey field.

    Comment

    Working...
    X