This is a migrated thread and some comments may be shown as answers.

Client Updating Method

3 Answers 52 Views
Notification
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 28 Jul 2011, 03:46 AM
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);
}

3 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 28 Jul 2011, 03:32 PM
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.

0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 28 Jul 2011, 03:33 PM
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"
0
Svetlina Anati
Telerik team
answered on 28 Jul 2011, 03:44 PM
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.

Tags
Notification
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Svetlina Anati
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or