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

Rare bug with with AutoPostback RadDock

2 Answers 75 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Guido Tapia
Top achievements
Rank 1
Guido Tapia asked on 26 Mar 2009, 04:40 AM

Hi All,

I have a bug that is a bit strange and hard to reproduce.  I think (not sure as I did not get the JS warnings) I was able to reproduce it on your demo site, here:
http://demos.telerik.com/aspnet-ajax/dock/examples/dynamicdocks/defaultcs.aspx

The steps to reproduce are:
- Dynamically created docks (with autopostback and Save/Load State).
- Click the header like crazy (about 10+ times)
- First I get a 'undefined' is null or not an object Line: 5869
- If I then try to move the dock, I get:
==========================================

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Thu, 26 Mar 2009 04:36:58 UTC

Message: 'undefined' is null or not an object
Line: 5869
Char: 1
Code: 0
URI: http://localhost/RiskShield/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_sm_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1247b7d8-6b6c-419f-a45f-8ff264c90734%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.1.311.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3af48f6488-574a-46fe-9b15-624f013d8c03%3a16e4e7cd%3af7645509%3a24ee1bba%3ae330518b%3a1e771326%3a8e6f0d33%3aed16cbdc%3a854aa0a7%3a874f8ea2%3a5a6d9d23

Message: Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: {"Top":0,"Left":0,"DockZoneID":"ctl00_c_rdzDash","Collapsed":false,"Pinned":false,"Resizable":false,"Closed":false,"Width":"305px","Height":"331px","ExpandedHeight":0,"Index":1}.
Line: 6
Char: 62099
Code: 0
URI: http://localhost/RiskShield/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_sm_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1247b7d8-6b6c-419f-a45f-8ff264c90734%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.1.311.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3af48f6488-574a-46fe-9b15-624f013d8c03%3a16e4e7cd%3af7645509%3a24ee1bba%3ae330518b%3a1e771326%3a8e6f0d33%3aed16cbdc%3a854aa0a7%3a874f8ea2%3a5a6d9d23

 



Any help would be greatly appreciated.

Thanks

Guido Tapia

2 Answers, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 26 Mar 2009, 04:17 PM
Hi Guido Tapia,

The problem is that once you drop a RadDock to the zone, an Ajax call is started. If you grab it again the RadDock will be floating and once the Ajax call is finished it will automatically add a control with the same ID.

You could change the example to use RadAjaxManager and RadAjaxLoadingPanel. This way, once an Ajax call is invoked, a loading panel will appears and you will not be able to move the RadDock until the Ajax request finish.

Kind regards,
Petio Petkov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Andrew
Top achievements
Rank 1
answered on 27 Jan 2011, 12:51 AM
Hi everyone,

I know this post is old, but I came across the same problem this week in a production application and came up with another alternative to using a loading panel described above...  Essentially, handle the AjaxManager's RequestStart and RequestEnd to set a variable indicating if the page is in the midst of an async request.  Then, for each RadDock, handle the client Command and DragStart events and cancel them if the variable indicates the page is still in async.

Check it out:

var isInAsync = false;
 
function AjaxRequestStart(sender, args) {
    isInAsync = true;
}
function AjaxRequestEnd(sender, args) {
    isInAsync = false;
}
function onDockCommand(sender, args) {
    args.set_cancel(isInAsync);
}
function onDockDragStart(sender, args) {
    args.set_cancel(isInAsync);
}

Someone thinking may wonder why not just stop at the DockPositionChanging instead of DragStart -- at that point, it's too late.  If the Dock is being grabbed while an async operation completes, you'll end up with two controls with the same ID (like in the original problem)...

Hope this helps someone! :)
Andy
Tags
Dock
Asked by
Guido Tapia
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or