Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Recurring appointments shown in a WebMonthView causes a javascript error
posted

Double clicking on a recurring appointment shown in a WebMonthView a javascript error is thrown at the following line:

ig_WebScheduleInfo.prototype._showAppointmentDialog =

function (dataKey, id, occur, prevOccur, nextOccur)
{
if(prevOccur != null)
   prevOccur = eval(prevOccur);
if(nextOccur != null)
   nextOccur = eval(nextOccur);
if(occur != null)
{
   occur = eval(occur); 
   var activity = this.getActivities().getItemFromKey(dataKey);  <--------- null returned
   activity.setStartDateTime(occur);
   activity._prevOccur = prevOccur; 
   activity._nextOccur = nextOccur;
   this.showAddAppointmentDialog(activity, id);
}
else
  
this._internalShowUpdateAppointmentDialog(dataKey, id, prevOccur, nextOccur);
}

 

the appointments are generated using a custom data provider built on WebScheduleDataProviderBase using the following sub:

 

    Private Sub FetchActivities(ByVal context As FetchActivitiesContext)
        ' Get a reference to all Appointment-related nodes in the XMLDocument
        Dim nodes As XmlNodeList = scheduleXml.SelectNodes("//appointment")

        ' Clear any existing activities
        context.Activities.Clear()

        For Each node As XmlNode In nodes
            ' Create a new Appointment with a reference to the ScheduleInfo object that requested the fetch
            Dim appointment As Appointment = New Appointment(Me.WebScheduleInfo)

            ' Configure the Appointment with the information in the data source
            appointment.Key = node.SelectSingleNode("key").InnerText
            appointment.Subject = node.SelectSingleNode("subject").InnerText
            appointment.StartDateTime = Me.StringToDate(node.SelectSingleNode("start").InnerText)
            appointment.EndDateTime = Me.StringToDate(node.SelectSingleNode("end").InnerText)
            appointment.ResourceKey = Me.WebScheduleInfo.VisibleResources.UnassignedResource.Key

            If node.SelectSingleNode("DayOfWeekMask").InnerText Then
                appointment.CreateRecurrence()
                appointment.Recurrence.Key = "rec_" & appointment.Key
                appointment.Recurrence.RecurrenceDayOfMonth = RecurrenceDayOfMonth.None
                appointment.Recurrence.EditType = RecurrenceEditType.Series
                appointment.Recurrence.DayOfMonth = node.SelectSingleNode("recurrenceDayOfMonth").InnerText
                appointment.Recurrence.DayOfWeekMask = node.SelectSingleNode("DayOfWeekMask").InnerText
                appointment.Recurrence.EndDateUtc = New SmartDate(9999, 12, 31)
                appointment.Recurrence.MaxOccurrences = 0
                appointment.Recurrence.MonthOfYear = 0
                appointment.Recurrence.Period = node.SelectSingleNode("recurrencePeriod").InnerText
                appointment.Recurrence.PeriodMultiple = node.SelectSingleNode("recurrencePeriodMultiple").InnerText
                appointment.RecurrenceKey = "rec_" & appointment.Key
            End If

            ' Add the Appointment to the Activities list in the context
            CType(context.Activities, IList).Add(appointment)
        Next
    End Sub