OnClientItemClickedHandler on beta Q1 2008

2 posts, 1 answers
  1. Pierre
    Pierre avatar
    212 posts
    Member since:
    Apr 2007

    Posted 01 Apr 2008 Link to this post

    After changing my suite for the beta Q1 2008 release my dynamic menu stop functionning.

    All the menu and sub menu are create in the server side at form load  for exemple this multi language menu :
                If Left(System.Threading.Thread.CurrentThread.CurrentCulture.Name, 2).ToLower = "fr" Then  
                    MenuItem.ImageUrl = "Images/Menu/Compte.gif" 
                    MenuItem.HoveredImageUrl = "Images/Menu/Compte_over.gif" 
                    MenuItem.ClickedImageUrl = "Images/Menu/Compte_sel.gif" 
                    MenuItem.Value = "MonCompte" 
                    MenuItem.Width = 110 
                Else  
                    MenuItem.ImageUrl = "Images/Menu/Account.gif" 
                    MenuItem.HoveredImageUrl = "Images/Menu/Account_over.gif" 
                    MenuItem.ClickedImageUrl = "Images/Menu/Account_sel.gif" 
                    MenuItem.Value = "MonCompte" 
                    MenuItem.Width = 110 
                End If 

    I set the value properties to "MonCompte" and in the client side function OnClientItemClickedHandler I read it and open a rad windows. THe point is after installing the Beta Q1 the value in the client side are always returned "undefined"

    Here my client code:
                function OnClientItemClickedHandler(sender, eventArgs)  
                {  
                    if(eventArgs._item._value == "Connecter")  
                    {  
                        var oWindow = radopen (null, "SeConnecter");  
                    }     
                      
                    if(eventArgs._item._value == "Deconnecter")  
                    {  
                        Sys.Services.AuthenticationService.set_defaultLogoutCompletedCallback(OnLogoutCompleted);  
                        Sys.Services.AuthenticationService.set_defaultFailedCallback(OnFailed);  
                        Sys.Services.AuthenticationService.logout(null, null, null, null);   
                    }  
                    if(eventArgs._item._value == "MonCompte")  
                    {  
                        var oWindow2 = radopen (null, "MonCompte");  
                    }  
                      
                    if(eventArgs._item._value == "ChangePassword")  
                    {  
                        var oWindow3 = radopen (null, "ChangePassword");  
                    }                                                                                        
                    if(eventArgs._item._value == "CreeCompte")  
                    {  
                        var oWindow4 = radopen (null, "CreeCompte");  
                    }                              
                } 

    any suggestion?
    Thanks
  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 02 Apr 2008 Link to this post

    Hi Pierre,

    You should change your code like this:

    if (args.get_item().get_value() == "Connecter")

    Using private variables (starting with underscore) is generally not a good idea because they may change in the future (got renamed or removed).

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top