View Full Version : [CLOSED] ext:Calendar EventStore appears call the webservice 3 or more times when page is loaded.

Apr 18, 2012, 8:27 PM

I have a ext:CalendarPanel in aspx page. EventStore is bind with a webservice.

When page is loaded (I think this process occurs in page_init, because some ext controls are not created in this step), my Webservice is called 3 times...

I think its occurs because the 3 views of my CalendarPanel.
I made a sample...
Pay attention to the dates that appear in msgbox inside the webservice.

Main Page

<%@ Page Language="vb" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

<script type="text/javascript">

var CompanyX = {
getCalendar: function () {
return CompanyX.CalendarPanel1;
getWindow: function () {
return CompanyX.EventWindow1;
dayClick: function (cal, dt, allDay, el) {
this.record.show.call(this, cal, {
StartDate: dt,
IsAllDay: allDay
}, el);
record: {
show: function (cal, rec, el) {
CompanyX.getWindow().show(rec, el);
edit: function (win, rec) {

<ext:ResourceManager ID="ResourceManager1" runat="server" Namespace="CompanyX"/>
<form id="form1" runat="server">
<ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
<ext:CalendarPanel ID="CalendarPanel1" runat="server"
<EventStore ID="EventStore1" runat="server" NoMappings="true">
<ext:AjaxProxy Url="/Events.asmx/GetEvents" Json="true">
<ActionMethods Read="POST" />
<ext:JsonReader Root="d" />
<ext:ModelField Name="StartDate" Type="Date" DateFormat="M$" />
<ext:ModelField Name="EndDate" Type="Date" DateFormat="M$" />
<CalendarStore ID="CalendarStore1" runat="server">
<ext:CalendarModel CalendarId="1" Title="Importante" ColorId="1" />
<ext:CalendarModel CalendarId="2" Title="Comercial" ColorId="2"/>
<ext:CalendarModel CalendarId="3" Title="Pessoal" ColorId="3"/>
<DayClick Fn="CompanyX.dayClick" Scope="CompanyX" />
<EventClick Fn="CompanyX.record.show" Scope="CompanyX" />
TitleTextAdd="Adicionar Novo."
TitleTextEdit="Editar evento"
<EditDetails Fn="CompanyX.record.edit" Scope="CompanyX" />


Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports System.Web.Script.Services

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:= WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class Events
Inherits System.Web.Services.WebService

<WebMethod()> _
<ScriptMethod()> _
Public Function GetEvents([start] As Date, [end] As Date) As Ext.Net.EventModelCollection
Dim evt As Ext.Net.EventModel
Dim vret As New Ext.Net.EventModelCollection

evt = New Ext.Net.EventModel
evt.CalendarId = 1
evt.StartDate = CDate(DateValue(Now) & " 08:00")
evt.EndDate = CDate(DateValue(Now) & " 09:00")
evt.Title = "test 1"
evt.Notes = "test"
evt.Location = "supera"


evt = New Ext.Net.EventModel
evt.CalendarId = 2
evt.StartDate = Now
evt.EndDate = DateAdd(DateInterval.Day, 1, Now)
evt.Title = "test 2"
evt.Notes = "test 2"
evt.Location = "supera"


MsgBox("Calling WebService" & vbCrLf & "start: " & [start] & vbCrLf & "end: " & [end], vbExclamation)

Return vret

End Function

End Class

Apr 19, 2012, 4:29 PM

Yes, it's a known problem. We will work on it. Hope to fix on next week.

Apr 19, 2012, 5:17 PM
Hi Daniil!

No problem... I'll be waiting then.

Thanks for your help.

May 09, 2012, 12:10 PM
The issue has been fixed in SVN, please update and re-test.

Thanks again for the report.

May 14, 2012, 1:58 PM
Hi Daniil!

I having a little problem with this!

My web service is called one time now... itīs right.

But the 'start' and 'end' arguments of my web service are getting with same date and my default viewmode is 'week' (ActiveIndex="1").

I think that the 'start' and 'end' arguments should receive the start date and end date of week.

As it is working, when my application is started, the calendarPanel is loaded only with the data of current day.

May 14, 2012, 2:42 PM
Thanks for the report. We will check.

May 14, 2012, 11:01 PM
Fixed in SVN. Please update and retest

May 15, 2012, 12:27 PM
Hi Vladimir!

Works fine now!

Thanks a lot.