Parameter?

2 posts, 0 answers
  1. Reiner Ebel
    Reiner Ebel avatar
    15 posts
    Member since:
    Jul 2009

    Posted 20 Oct 2009 Link to this post

    Hello, I have a big Problem. I call the Fileexplorer with the Button from client side:

    function OpenFileExplorerDialog(val) {  
                _globobjectartselect = val;  
                var wnd = $find("<%= ExplorerWindow.ClientID %>");  
                wnd.set_navigateUrl("../../filemanager/explorer.aspx?search=" + val);  
                wnd.show();  
            }  
     
    function OnFileSelected(wnd, fileSelected) {  
                switch(_globobjectartselect)  
                {  
                    case "Picture":  
                        var textbox = $find("<%= txtPictureFilePath.ClientID %>");  
                        textbox.set_value(fileSelected);  
                        break;  
                    case "Video":  
                        var textbox = $find("<%= txtVideoFilePath.ClientID %>");  
                        textbox.set_value(fileSelected);  
                        break;  
                }  
            } 

    I pass a parameter to the link wnd.set_navigateUrl(). This parameter is to set the search pattern.

    Fileexplorer:

    protected void Page_Load(object sender, EventArgs e)  
        {  
            if (Request.QueryString["search"] != null && Request.QueryString["search"] != "")  
            {  
                switch (Request.QueryString["search"])  
                {  
                    case "Picture":  
                        string[] patterns1 = { "*.jpg", "*.jpeg", "*.gif", "*.png", "*.bmp" };  
                        RadFileExplorer1.Configuration.SearchPatterns = patterns1;  
                        break;  
                    case "Video":  
                        string[] patterns2 = { "*.mpg", "*.mpeg", "*.avi", "*.divx", "*.wmv" };  
                        RadFileExplorer1.Configuration.SearchPatterns = patterns2;  
                        break;  
                }              
            }  
        } 

    This works fine for one call. When i call the picture object first then its ok. In the second call the search patterns are soon the patterns from Picture. The Explorer does not load the new settings.

    How can I solve the problem? Its very important for me.

    Thank you

    Reiner
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 23 Oct 2009 Link to this post

    Hi Reiner,

    In your scenario I recommend you set the ReloadOnShow="true" in ExplorerWindow's declaration. This will cause the RadWindow's content to be reloaded every time it is shown. Also you could set it on the client by using this approach:

    function OpenFileExplorerDialog(val) { 
                _globobjectartselect = val; 
                var wnd = $find("<%= ExplorerWindow.ClientID %>");
                wnd.set_set_reloadOnShow(true);
                wnd.set_navigateUrl("../../filemanager/explorer.aspx?search=" + val); 
                wnd.show(); 
            }

    This will cause the window to be reloaded (the Page_Load event to be called) every time ExplorerWindow is shown).
    I hope this helps.

    Sincerely yours,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top