Declined
Last Updated: 01 Nov 2013 13:06 by ADMIN
Jarred
Created on: 01 Feb 2013 15:13
Category: Notification
Type: Feature Request
2
Radnotification.show overload with AutoCloseDelay and ShowInterval properties
It would be incredibly helpful to add the AutoCloseDelay and ShowInterval properties to the Show function of the RadNotification control so I wouldn't have to add a wrapper to my base page class.
3 comments
ADMIN
Stanimir
Posted on: 08 Feb 2013 08:01
At this point I decided that I am not going to implement public void Show (int AutoCloseDelay , int ShowInterval) method of RadNotification. The usage of such method is too ambiguous (this includes the client side as well). There are too many unexpected behaviors. Will the parameters overwrite the predefined AutoCloseDelay and ShowInterval properties. Some clients might want to overwrite them, others not. Some might want to overwrite only the first one for example. Since the point is the RadNotificataino not to be wrapped in an inheriting class, one approach for achieving the functionality is the following static utility class,method.

public static class RadNotificationUtils
{
	public static void ShowNotificataion(Page page, RadNotification notification, int AutoCloseDelay , int ShowInterval)
	{
		//use a unique id for the script block to be able to manually remove it from the head after execution
		string scriptBlockName = Guid.NewGuid().ToString().GetHashCode().ToString("x");
		//add unique sufix to the name in case two dialogs from the same type are opened just one after the other
		string name = notification.ClientID + scriptBlockName;
		//add and remove the function to the load event; do the same for the script element
		string script = String.Format(@"
<script type='text/javascript' id='{2}'>
	function {0}()
	{{
		var n = $find('{1}');
		n.set_autoCloseDelay({3});
		n.set_showInterval({4});
		alert(n.get_autoCloseDelay());
		alert(n.get_showInterval());
		n.show();
		Sys.Application.remove_load({0});
		var scriptBlock = document.getElementById('{2}');
		if(scriptBlock) 
		{{
			var parent = scriptBlock.parentNode;
			if(parent) parent.removeChild(scriptBlock);
		}}
	}};
	Sys.Application.add_load({0});
</script>", name, notification.ClientID, scriptBlockName, AutoCloseDelay, ShowInterval);
			ScriptManager.RegisterStartupScript(page, page.GetType(), scriptBlockName, script, false);
	}
}
Jarred
Posted on: 06 Feb 2013 14:21
I would want it in the server side Show function as I have a pretty elaborate server side setup connected into multiple WCF Services.
ADMIN
Stanimir
Posted on: 04 Feb 2013 14:10
Just to be sure, which show method are you referring? The client or the server side? The overload word in the caption is pointing the server side, however I need this to be confirmed.