Client Updating Method

4 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 27 Jul 2011 Link to this post

    When bound to a webservice, how do I intercept whats going to show in the panel and show something custom?

    I'm returning a serialized javascript object so I want to deserialize it, and just just ONE property of the object.

    This is what I've been trying, but I think the cancel is stopping the content from showing in the panel?...or is this the wrong method?

    function onSaveNotificationPanel_Updating(sender, args) {
        var callbackresult = Sys.Serialization.JavaScriptSerializer.deserialize(args.get_content());
         
        //Put the content into the panel
        args.set_cancel(true); 
        args.set_content(callbackresult.Message);
    }
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 28 Jul 2011 Link to this post

    Hello Steve,

    Indeed, setting cancel means that you do not want to set the new content and as far as I understand you do not want this but to put another content instead.

     I do not have all your code but I think that keeping this code but removing the cancelation should do the trick:

    function onSaveNotificationPanel_Updating(sender, args) {
      
        var callbackresult = Sys.Serialization.JavaScriptSerializer.deserialize(args.get_content());
      
          
      
        //Put the content into the panel
      
     
        args.set_content(callbackresult.Message);
     
     
    }


    This worked on my side with a simple custom message. Would you please try whether removing the set_cancel call will resolve the problem? If you still need assistance after that, please prepare a simple, fully runnable reproduction demo, open a new support ticket and send it to me along with detailed reproduction steps and explanations and I will do my best to help.

    All the best,
    Svetlina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 28 Jul 2011 Link to this post

    Oh okay thanks

    I assumed if it wasn't cancelled the content would show up, then my javascript would remove it and replace it with the set_content() html I define...just wanted to avoid "popping"
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 28 Jul 2011 Link to this post

    Hi Steve,

     Updating the notification does not actually show (pop) it - it just checks the returned value - you can verify this in the demo below:

    http://demos.telerik.com/aspnet-ajax/notification/examples/updateinterval/defaultcs.aspx

    If you comment the show() client call, the notification will not show but the updates will continue. I assume that you have used another approach - e.g LoadContentOn=EveryShow - I recommend to use the approach shown in the demo for your case and call explicitly show() after you have replaced the content.

    Let me know if you need further assistance with that.

    Regards,
    Svetlina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top