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

Bug in RadDock?

1 Answer 70 Views
Dock
This is a migrated thread and some comments may be shown as answers.
dburgett
Top achievements
Rank 1
dburgett asked on 19 Aug 2008, 01:23 AM

I have found an issue trying to change the content of a RadDock after the dock has been moved.  Specifically, I can change the content with server-side code prior to moving the RadDock around on the page...after I move it, I get the following error:


Sys.InvalidOperationException: Two components with the same id 'RadDock1' can't be added to the application.

Here's the code for a very simple example is below. One RadDock and buttons. 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">

<telerik:RadDock ID="RadDock1" runat="server" Width="300px">

<ContentTemplate>

<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

</ContentTemplate>

</telerik:RadDock>

<br />

<br />

<br />

<asp:Button ID="Button1" runat="server" Text="Button" />

</telerik:RadAjaxPanel>


Clicking the button changes the text of the label inside the RadDock:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

label1.text =

"1"

End Sub



To demonstrate the bug: Load the page, click the button. The text inside the RadDock changes correctly. Now drag the RadDock to somewhere else on the page and click the button again. The JavaScript error listed above occurs.


Is this not correct use of this control? Is there something I'm missing?

Thanks,
david

1 Answer, 1 is accepted

Sort by
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 19 Aug 2008, 08:40 AM
This problem is not in RadDock control. Once you drag it, the RadDock position in the dom is changed. When you press the button a new RadDock with the same ID is added to the Page but the old one is still there.
If you want to use RadDock with Ajax, you should use one of the following approaches:
 - If you want to update only the content in the RadDock you should add an update panel in the RadDock and add all content into the update panel. You can update the content with triggers. A simple example illustrating this you can find here:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Dock/Examples/Default/DefaultCS.aspx
- You can create all RadDocks with DockMode = Docked  and update all RadDockZones on every Ajax call.
- If you want to save the dock positions on the server, you can use the following example as a reference:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Dock/Examples/MyPortal/DefaultCS.aspx

If you want to update only the content in the RadDock, my suggestion is to use the first approach.
Tags
Dock
Asked by
dburgett
Top achievements
Rank 1
Answers by
Obi-Wan Kenobi
Top achievements
Rank 1
Share this question
or