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

  1. #1

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

    Hi

    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">
        <title></title>
               
    <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) {
                    win.hide();
                    rec.commit();
                    CompanyX.getCalendar().showEditForm(rec);
                }
            }
        };
    </script>
    
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Namespace="CompanyX"/>
        <form id="form1" runat="server">
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">           
            <Items> 
                <ext:CalendarPanel ID="CalendarPanel1" runat="server" 
                    ActiveIndex="1">                    
                    <EventStore ID="EventStore1" runat="server" NoMappings="true">
                        <Proxy>
                            <ext:AjaxProxy Url="/Events.asmx/GetEvents" Json="true">                                        
                                <ActionMethods Read="POST" />
                                <Reader>
                                    <ext:JsonReader Root="d" />
                                </Reader>
                            </ext:AjaxProxy>
                        </Proxy>     
                        <Mappings>
                            <ext:ModelField Name="StartDate" Type="Date" DateFormat="M$" /> 
                            <ext:ModelField Name="EndDate" Type="Date" DateFormat="M$" />
                        </Mappings>                        
                    </EventStore>                   
                    <CalendarStore ID="CalendarStore1" runat="server">                        
                        <Calendars>                            
                            <ext:CalendarModel CalendarId="1" Title="Importante" ColorId="1" />
                            <ext:CalendarModel CalendarId="2" Title="Comercial" ColorId="2"/>
                            <ext:CalendarModel CalendarId="3" Title="Pessoal" ColorId="3"/>
                        </Calendars>                    
                    </CalendarStore>                    
                    <Listeners>                        
                        <DayClick Fn="CompanyX.dayClick" Scope="CompanyX" />                        
                        <EventClick  Fn="CompanyX.record.show" Scope="CompanyX" />                    
                    </Listeners>                
                </ext:CalendarPanel>
            </Items>
        </ext:Viewport>
        <ext:EventWindow            
             ID="EventWindow1"            
             runat="server"            
             Hidden="true" 
             TitleTextAdd="Adicionar Novo."
             TitleTextEdit="Editar evento"
             CalendarStoreID="CalendarStore1">            
             <Listeners>            
                <EditDetails Fn="CompanyX.record.edit" Scope="CompanyX" />            
             </Listeners>       
        </ext:EventWindow>
        </form>
    </body>
    </html>
    WebService
    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"
    
            vret.Add(evt)
    
            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"
    
            vret.Add(evt)
    
            MsgBox("Calling WebService" & vbCrLf & "start: " & [start] & vbCrLf & "end: " & [end], vbExclamation)
    
            Return vret
    
        End Function
    
    End Class
    Last edited by Daniil; May 09, 2012 at 10:22 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Yes, it's a known problem. We will work on it. Hope to fix on next week.
  3. #3
    Hi Daniil!

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

    Thanks for your help.
  4. #4
    The issue has been fixed in SVN, please update and re-test.

    Thanks again for the report.
  5. #5
    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.
  6. #6
    Thanks for the report. We will check.
  7. #7
    Fixed in SVN. Please update and retest
  8. #8
    Hi Vladimir!

    Works fine now!

    Thanks a lot.

Similar Threads

  1. Ext:Calendar Panel set interval between times
    By gefferson.librelato in forum 1.x Help
    Replies: 7
    Last Post: Jul 23, 2012, 2:28 PM
  2. Why Calendar cannot render with EventStore?
    By tonyls in forum 1.x Help
    Replies: 5
    Last Post: Mar 22, 2012, 8:19 PM
  3. Replies: 1
    Last Post: Jul 07, 2011, 4:07 PM
  4. [CLOSED] [1.0] User Control loaded several times
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 07, 2011, 10:33 AM
  5. [CLOSED] Calendar - EventStore.SubmitData
    By ndotis in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 17, 2011, 11:46 PM

Posting Permissions