get_schedulerInfo() when OnClientAppointmentWebServiceInserting

8 posts, 0 answers
  1. Jason Li
    Jason  Li avatar
    17 posts
    Member since:
    Apr 2010

    Posted 02 May 2012 Link to this post

    Hi,

    I am using RadScheduler with websevice (v.2012.1.411). I use args.get_schedulerInfo() to pass extra info to the webservice on event OnClientAppointmentsPopulating,  it is working well.

    But when I try to use args.get_schedulerInfo() in event OnClientAppointmentWebServiceInserting, It pops up javascrip undefined error. I checked the online document http://www.telerik.com/help/aspnet-ajax/p_telerik_web_ui_radscheduler_onclientappointmentwebserviceinserting.html , This property should be supported in this event. here is the code,
    function OnClientAppointmentWebServiceInserting(sender, args) {
        var schedulerInfo = args.get_schedulerInfo();
        alert(schedulerInfo);
        var userName = '<%=UserName %>';               
        schedulerInfo.UserName = userName;
    }

    Thanks in advance

    Jason
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 02 May 2012 Link to this post

    Hi Jason,

    Thank you for reporting this problem.

    I did some testing on the case and verified that there is indeed a problem. Here are some more details that I found - args.get_schedulerInfo() actually returns an object as expected, but it is of type SchedulerInfo instead of MyCustomSchedulerInfo (or whatevet it is called in your case). As a result of this, the additional fields that you expose in your custom class are not available - args.get_schedulerInfo().UserName.

    I will log the issue and we will fix it for the next release.

    Please, accept our apologies for the caused inconvenience.

    Greetings,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jason Li
    Jason  Li avatar
    17 posts
    Member since:
    Apr 2010

    Posted 02 May 2012 Link to this post

    Thanks Peter. But actually the issue is that args.get_schedulerInfo() is not recognised at all. Please see the code attached, it stops at the first line. it looks like the get_schedulerInfo() method is not exposed to the event args. btw, My dev environment is VS2010 and the target framework is 3.5.

    I have also found another document from Telerik, http://www.telerik.com/help/aspnet-ajax/scheduler-onclientappointmentwebserviceinserting.html  , it says this event OnClientAppointmentWebServiceInserting does not support the get_schedulerInfo(). I am a bit confused with the two documents (the doc link in my question post), not sure which one is the correct one.

    I want to pass some parameters when insert a new appointment, the insert web method does take two parameters, type of ISehedulerInfo and Appointment, but I don't know how to pass the ISehedulerInfo parameter...

    function OnClientAppointmentWebServiceInserting(sender, args) {
        var schedulerInfo = args.get_schedulerInfo();
    }

  5. Jason Li
    Jason  Li avatar
    17 posts
    Member since:
    Apr 2010

    Posted 03 May 2012 Link to this post

    Hi Peter, 
    Does OnClientAppointmentWebServiceInserting support the get_schedulerInfo()?

    Cheers
  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 07 May 2012 Link to this post

    Hello Jason,

    The problem that you experience - "that args.get_schedulerInfo() is not recognised at all" is specific to .NET 3.5. Is it possible for you to migrate to framework 4.0?


    Kind regards,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Jason Li
    Jason  Li avatar
    17 posts
    Member since:
    Apr 2010

    Posted 07 May 2012 Link to this post

    Many thanks Peter, it makes sense. I will have a try with .net 4. For now I will use session as a workaround.
  8. Jason Li
    Jason  Li avatar
    17 posts
    Member since:
    Apr 2010

    Posted 07 May 2012 Link to this post

    Have tried in .net 4, same javascript error  [object Object] has no method 'get_schedulerInfo' . Hope Telerik can fix this issue in the next release.
  9. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 10 May 2012 Link to this post

    Hello Jason,

    Further testing revealed that actually there is no bug in the .net 4.0 build. The only issue is that the intellisense of the debug tools does not reveal the additional fields exposed in the custom class that inherits SchedulerInfo. However, everything works as expected. Here is a video capture as part of our testing -
    http://screencast.com/t/nZC87XfxF.

    I have attached a sample for reference. There I set the TeacherID property to 1 in OnClientAppointmentWebServiceInserting and use a flag to prevent resetting it in OnClientAppointmentsPopulating. The final result is that when you insert a new appointment, only appointments for Teacher 1 are visible.

    var flag = true;
           function OnClientAppointmentsPopulating(sender, eventArgs) {
               //debugger;
               if(flag)
               eventArgs.get_schedulerInfo().TeacherID = teacherID;
           }
           function OnClientAppointmentWebServiceInserting(sender, eventArgs)
           {
               //debugger;
               eventArgs.get_schedulerInfo().TeacherID = 1;
               flag = false;
               
           }


    Greetings,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017