control initialization lost on postback/callback

4 posts, 0 answers
  1. Paul Hopper
    Paul Hopper avatar
    25 posts
    Member since:
    May 2006

    Posted 31 Jul 2009 Link to this post

    In the FileExplorer's init event, I am setting a custom provider and the upload and delete paths (based on custom security implementation).  Before upgrading to the Q2 release, everything worked fine.  Now...

    With the code just as it was, the user would get the first document in the list no matter which document the user clicked on.  OpenFile is disabled so that a javascript function can pass the item's URL to a special download handler.  The item passed to the javascript function was always the first item.

    My "solution" was to wrap everything in the init function inside the following if condition:
    if (!Page.IsCallback && !Page.IsPostBack) 
        docExplr.Configuration.ContentProviderTypeName = typeof(FileContentProvider).AssemblyQualifiedName; 
        /// other logic 
        docExplr.Configuration.DeletePaths = UserOwnedPaths; 
        docExplr.Configuration.UploadPaths = UserOwnedPaths; 
        docExplr.EnableCreateNewFolder = true

    That fixed the issue, great... except that now the FileExplorer control doesn't appear to be using the custom content provider for postbacks.

    Another issue I noticed was that I have some links that use a querystring parameter to set the initial path for the FileExplorer.  Even when my partial "solution" is in place, it does not work in this scenario unless I switch to a different folder and then switch back.

    I suspect that these issues are related to the change in the Q2 release so that the tree and grid are populated on the initial page load, rather than using callbacks.  I'm hoping Q2 SP1 will fix those issues, but I see that hasn't been released yet.  Has anyone else encountered this?  Figured out a fix for it?
  2. Paul Hopper
    Paul Hopper avatar
    25 posts
    Member since:
    May 2006

    Posted 31 Jul 2009 Link to this post

    For what it's worth, I just downloaded the latest build and that didn't solve the issue.

    If I comment out the if condition, the FileExplorer uses the custom provider consistently (as is evident in the upload and delete rights for folders expanded in subsequent requests), but it then consistently chooses the first item in the grid no matter which item was actually selected.

    If I leave that condition there, the FileExplorer uses the custom provider only on the initial page load (as is evident in the rights for folders expanded on the initial page load vs those expanded in subsequent requests) and it chooses the first item in the grid no matter which item was actually selected only during the initial page load (the item selection is consistently correct for subsequent requests.

    So I'm still looking for a fix that will work for all of these situations.  Was hoping someone had already figured this out and could share a quick fix, but I'm beginning to think I should open a support ticket. :/
  3. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 05 Aug 2009 Link to this post

    Hi Paul,

    I tested with the latest build (2009.2.804) and I was not able to reproduce the described problems. The custom provider is set correctly on every request (please note that you need to assign the ContentProvider before you set the other properties). Also the InitialPath property works as expected and selects the desired file on initial load.
    Could you please find my test project attached to the thread, test it on your side with the latest version and let me know the result? In case that the problem still exists, please open a new support ticket and send us a runnable project with the detailed reproduction steps that I need to follow in order to reproduce the problem. I will check it and do my best to provide a working solution as soon as possible.

    Kind regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  4. Paul Hopper
    Paul Hopper avatar
    25 posts
    Member since:
    May 2006

    Posted 19 Aug 2009 Link to this post

    Fiko,

    Thank you!  The build I was using was slightly older.  When I updated to the 2009.2.804 build, everything worked just as it should.  Thanks again!

    Paul
Back to Top