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

RadDock, JS exception when RadDock is closing and appearing again.

2 Answers 61 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 11 Jan 2011, 04:19 PM
Hello All, 
I attached simple example, using which is easy to reproduce issue by the following steps:
1. lunch application
2. press "Show test RadDock"
3. press button again.
4. move RadDock.
So, after that you should see two RadDocks.
Other issue:
1. lunch application
2. press button
3. move RadDock
4. close RadDock
5. press button
6. move RadDock
7. close RadDock
8. press button
You will see the follow JS exception:
Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: {"Top":155,"Left":510,"DockZoneID":"","Collapsed":false,"Pinned":false,"Resizable":false,"Closed":false,"Width":"300px","Height":null,"ExpandedHeight":0,"Index":-1}.

Could you please say what I do wrong? Or advise some workarounds?

2 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 11 Jan 2011, 04:26 PM
I remove BIN and RadSpell folders to reduce size and upload there: http://zalil.ru/30314186
0
Pero
Telerik team
answered on 13 Jan 2011, 03:47 PM
Hi Michael,

The problem comes from the fact that the RadDock control has not been correctly ajaxified. When it is moved on the client, it is actually moved in the DOM tree. In your case, on first page load, the dock is child to the AjaxPanel, and if you show it and then drag it, you are actually dragging it out from the AjaxPanel. On the next Ajax request of the same AjaxPanel, the panel will be updated and it will try to recreate the same dock, since the dock is missing (it is moved outside). This means the same dock will appear twice, and two client objects will be created for the same control, which on the other hand results in a JS error.
Basically, no matter what you do with the dock, after it has been moved outside the AjaxPanel, JavaScript error will be thrown, at one time or another.

To avoid such problems, you should ajaxify the RadDock controls in the following ways:
  • Place the dock in a docking zone, and place the zone in an ajax panel. Make sure when ajax requests occur, the dock is always in the zone. The best way to ensure this is by making the dock always docked to a zone, i.e. DockMode="Docked".
  • Ajaxify the dock's content, i.e. the dock itself is not necessarily residing in AjaxPanel, but the dock's content is placed inside an AjaxPanel.

Kind regards,
Pero
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Dock
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Pero
Telerik team
Share this question
or