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

RadDock & UpdatePanel Problem

21 Answers 823 Views
Dock
This is a migrated thread and some comments may be shown as answers.
luca bongioanni
Top achievements
Rank 1
luca bongioanni asked on 29 May 2007, 06:53 AM
Hi telerik,

I would like to make a RadDock Objects Ajax Enabled.
I've put this objects into an UpdatePanel.

So i run my application, drag and drop the RadDock Object and click on a CustomCommand or a PinUpPinCommand with property AutoPostBack = True

But i give that error: "Sys.InvalidOperationExeption: Two Components with the same id "RadDock1" can't be added to the application"..

If i try to remove the UpdatePanel wich contains the RadDock Objects will work correctly whitout errors...

Why????

Thanks in Advice

This is the code of my .aspx page (The UpdatePanel3 is Rem)
<asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
       <%-- <asp:UpdatePanel ID="UpdatePanel3" runat="server">  
            <ContentTemplate>--%> 
                <telerik:RadDock ID="RadDock1" runat="server" DockMode="Floating" Pinned="false">  
                    <Commands> 
                        <telerik:DockCommand AutoPostBack="true" /> 
                        <telerik:DockPinUnpinCommand AutoPostBack="true" /> 
                        <telerik:DockExpandCollapseCommand /> 
                    </Commands> 
                    <ContentTemplate> 
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">  
                            <ContentTemplate> 
                                <radDk:RadEditor ID="RadEditor1" runat="server" Width="200px" Height="200px" ShowHtmlMode="false" 
                                    ShowPreviewMode="false" ShowSubmitCancelButtons="true" EnableDocking="false" 
                                    FocusOnLoad="true" ToolsFile="ToolbarRadEditor.xml">  
                                </radDk:RadEditor> 
                                <asp:Label ID="Lbl1" runat="server"></asp:Label> 
                                <asp:Button ID="Btn1" runat="server" Text="Click Me" /> 
                            </ContentTemplate> 
                            <Triggers> 
                                <asp:AsyncPostBackTrigger ControlID="RadDock1" EventName="Command" /> 
                            </Triggers> 
                        </asp:UpdatePanel> 
                    </ContentTemplate> 
                </telerik:RadDock> 
                <telerik:RadDock ID="RadDock2" runat="server" DockMode="Floating" Pinned="false">  
                    <Commands> 
                        <telerik:DockCommand AutoPostBack="true" /> 
                        <telerik:DockPinUnpinCommand AutoPostBack="true" /> 
                        <telerik:DockExpandCollapseCommand /> 
                    </Commands> 
                    <ContentTemplate> 
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">  
                            <ContentTemplate> 
                                <radDk:RadEditor ID="RadEditor2" runat="server" Width="200px" Height="200px" ShowHtmlMode="false" 
                                    ShowPreviewMode="false" ShowSubmitCancelButtons="true" EnableDocking="false" 
                                    FocusOnLoad="true" ToolsFile="ToolbarRadEditor.xml">  
                                </radDk:RadEditor> 
                                <asp:Label ID="Label1" runat="server"></asp:Label> 
                                <asp:Button ID="Button1" runat="server" Text="Click Me" /> 
                            </ContentTemplate> 
                            <Triggers> 
                                <asp:AsyncPostBackTrigger ControlID="RadDock2" EventName="Command" /> 
                            </Triggers> 
                        </asp:UpdatePanel> 
                    </ContentTemplate> 
                </telerik:RadDock> 
            <%--</ContentTemplate> 
        </asp:UpdatePanel>--%> 

21 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 29 May 2007, 08:21 AM
Hi,

We tested your code and reproduced the problem. We will need some time to investigate the origin of the issue and we will keep you informed on our progress.

Sincerely yours,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
luca bongioanni
Top achievements
Rank 1
answered on 29 May 2007, 02:25 PM
Hi telerik,

i've found a little solution for this problem.

If i set in UpdatePanel3 the property UpdateMode="Conditional" the RadDock object work correctly.

Is a possible solution for this problem??

Thanks
0
Petya
Telerik team
answered on 30 May 2007, 11:45 AM
Hi,

Unfortunately, for now the problem seems to be more serious. We are working on it and will keep you informed on our progress.


Greetings,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Colin Bull
Top achievements
Rank 1
answered on 31 May 2007, 10:03 AM
Im currently having a similar problem with the RadDock and UpdatePanel, i am dynamicly creating Dock objects and adding them to a page, everything works fine when it loads up first time but when i move an object about to perform a post back i get the following message:

"Sys.InvalidOperationException: Could not find UpdatePanel with ID '1461_162170_C_ctl00_up_1', If it is being updated dynamically then it must be inside another UpdatePanel."

I thought this could have been caused by having duplicate id's on the Dock objects but they all are unique.



0
Colin Bull
Top achievements
Rank 1
answered on 01 Jun 2007, 01:43 PM
I think i have solved the problem i reported, it seems that if i had the id of a dock object the same as the uniquename then this caused the error.
0
luca bongioanni
Top achievements
Rank 1
answered on 14 Jun 2007, 06:38 AM
Any new news??

Thanks in advice
0
Valeri Hristov
Telerik team
answered on 14 Jun 2007, 11:55 AM
Hello,

I should explain a bit why the problem happens. When you add a control in the ContentTemplate of an UpdatePanel, the latter inserts the control HTML on the page. The same applies to RadDock. However, RadDock can be moved on the page and this modifies its position in the DOM tree, e.g. if you move a RadDock control, which was initially inside an UpdatePanel, it will be no longer a child of this UpdatePanel. Now comes the problem: when you add dynamically a RadDock on the page with ID=RadDock1, then move it and then initiate AJAX request, the UpdatePanel will add a new RadDock control with the same ID on the page, because the first RadDock is no longer inside it, hence the error.

The resolution is to use UpdatePanels only for adding RadDock controls on the page, which will be immediately docked into a RadDockZone control, as shown in our online demos, or wrap the RadDockZone controls with UpdatePanels and prevent the docks from undocking. This will ensure that the RadDock controls will be always in UpdatePanels and will avoid the problem.

We will need more time to come with a graceful solution, which will be included in RadDock "Prometheus" in one of its upcoming updates.

Best wishes,
Valeri Hristov (Senior Developer, MCSD)
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Brian Drought
Top achievements
Rank 1
answered on 24 Jul 2007, 04:43 PM
Hi, I'm getting the same error:

"Sys.InvalidOperationException: Could not find UpdatePanel with ID 'RadDock1_C_ctl00_UpdatePanel1', If it is being updated dynamically then it must be inside another UpdatePanel."

You can actually reproduce it on your online demo:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Dock/Examples/MyPortal/DefaultCS.aspx

If you add any of the controls very quickly (i.e. just hitting the button fast) you get the same error.

Do you guys have a fix on the way for this ? If not, I'll have to resort to recoding everything for the old RadDock control.

Regards,

  Brian
0
alexta
Top achievements
Rank 1
answered on 26 Jul 2007, 07:33 PM
Has anyone been able to get this control working w/ update panels?

I was looking at the rendered javascript and suspect that modifications to the embedded web resource javascripts would make this possible for this particular scenario... currently the javascript calls window.TheRadControlID ... where perhaps window.parent.TheRadControlID may work.. any suggestions / ideas on how to make this control work inside an update panel?...
0
Valeri Hristov
Telerik team
answered on 27 Jul 2007, 02:48 PM
Hello alexta,

Why do you need to put RadDock control inside UpdatePanel? Why putting the UpdatePanel inside the RadDock control does not work for you?

Greetings,
Valeri Hristov (Senior Developer, MCSD)
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
alexta
Top achievements
Rank 1
answered on 28 Jul 2007, 07:36 PM
Thanks for the reply -

The usage currently is to have a RadDock control inside an UpdatePanel because we cannot have full postbacks. We need to do partial postbacks on the particular update panel we use, where the RadDock would then load with infromation relative to the context passed to it.

A user clicks on a link somewhere on the page, and the update panel gets a postback which loads the rad dock with rad dockable objects relevant to the item the usre clicked on... when the user clicks on another item, the update panel postbacks again which refreshes the content in the rad dock without doing a full postback..

i dont know if this was clear - hopefully somewhat clear enough to where it is understandable and i can get more feedback on what options i may have to make this work. If you can think of another way of implementing this requirement of avoiding full page postbacks - please share!
0
Petya
Telerik team
answered on 30 Jul 2007, 01:08 PM
Hi alexta,

There exist some specifics of using RadDock in UpdatePanel because of the move functionality of the control. More information you can read here. Therefore, I recommend you not to place the docks inside an UpdatePanel just to ajaxify their adding to the page, but follow the approach we have taken in our online demos for adding the docks.

Kind regards,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
alexta
Top achievements
Rank 1
answered on 30 Jul 2007, 08:47 PM
Thanks for the reply,

The code you refer to is dealing w/ the new beta prometheus pack. Is it possible to use the current version for this purpose or not? I didnt really seem to get that answered.

Thanks for your prompt replies.
0
Petya
Telerik team
answered on 31 Jul 2007, 06:28 AM
Hello alexta,

We strongly recommend the usage of RadDock Prometheus over the "regular" RadDock.  RadDock Prometheus is based on MS AJAX and works much better with AJAX that the "regular" RadDock. Furthermore, we have concentrated our main developer efforts on the Prometheus control for feature enhancements and improvements whereas "regular" RadDock will receive only basic fixes. More information why you should use Prometheus and what does Beta version in this case mean you can find here.

Sincerely yours,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
lchesnais
Top achievements
Rank 1
answered on 13 Jan 2008, 06:42 PM
@Telerik : The issue raised by Brian about Telerik sample is still open.
I just tested to click several time on the button and I get the error message.

Is the sample that generates the issue or the control itself?

BR, Laurent
0
Petya
Telerik team
answered on 15 Jan 2008, 12:53 PM
Hello lchesnais,

This issue occurs because one AJAX requests begins before the previous one has ended and they overlap. One suggestion is to disable the Add button when one AJAX request begins and enable it when it ends.

Greetings,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
BSolveIT
Top achievements
Rank 2
answered on 22 Jan 2008, 11:13 PM
Hi

I've got a project thats using Q3 Prometheus and I'm also encountering this problem.

The error only occurs if the session times out before the user leaves the page, then does something that causes an ajax postback.  For example, moving a dock to a new location.

Any sign of a solution to this yet?

Many thanks!
Mark.
0
Tsvetie
Telerik team
answered on 25 Jan 2008, 03:23 PM
Hi BSolveIT,
There is an inherent problem with MS AJAX and RadDock when a dock is in an UpdatePanel and is move out of it. The MS AJAX framework is implemented in such a way that it expects that MS AJAX controls rendered in an UpdatePanel are not moved in the DOM of the page. When moved, problems begin as the framework is not able to dispose them properly, and the it cannot re-create them - javascript errors are thrown.

In the particular scenario, it is exactly this that is happening. The correct way to go would be to place UpdatePanels inside the RadDock controls. The result would be that RadDock will work fine, and AJAX will work fine. However, if the RadDock objects themselves are expected to be both moveable around the page AND be updatable from their original UpdatePanel - this will not work out of the box (at least for now).

We are currently investigating a possible workaround that will "trick" the MS Ajax framework into "believing" that docks are where they were when the page was loaded. However, even if this succeeds, it will be a hack of the framework, rather than a correct, reliable solution.

As already stated, we have concentrated our main developer efforts on the Prometheus control for feature enhancements and improvements whereas "regular" RadDock will receive only basic fixes. That is why, the "trick" we are working on will only be implemented in the Prometheus RadDock. I cannot tell you when this will be ready, but as many people ask for it, we will do our best to implement it for SP2, scheduled for the end of February.

Best wishes,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
BSolveIT
Top achievements
Rank 2
answered on 25 Jan 2008, 04:19 PM
Hi Tsvetie

Thanks for the update - it is prometheus I'm using so hopefully your 'trick' will do the job for me.

Interestingly though, the error occurs for me even if the docks aren't moved.  I have a page that uses radtooltip to dynamically load some content when things are hovered over.  The error we've been talking about occurs if the session times out and then the user hovers over something that dynamically loads a toolip.

Looking forward to the SP2 update!  ;-)

Cheers
Mark
0
Petya
Telerik team
answered on 30 Jan 2008, 02:39 PM
Hello BSolveIT,

We investigated the problem with the session timeout and we were able to reproduce it - just to mention that the error we got is Sys.WebForms.PageRequestManagerServerErrorException 12030. We spent time researching it but for now we can only say that the problem seems to be in the MS AJAX framework and the only workaround we can suggest at the moment is not to let the session expire - one possible way to achieve this can be found here. Also, just to mention that it seems that there are different issues discussed in this thread and it is the problem of having floating docks work with AJAX that we are investigating for a solution.

Regards,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Rick Aberle
Top achievements
Rank 1
answered on 29 Sep 2008, 09:34 PM
I also ran into same issue. It is related that radDock is outside DockZone.

I check if DockState.DockZoneID is empty or not. If it is empty, I call Reposne.End() to provent the error happens. It works pretty ok for me, because I do want to user go further, if they put RadDock outside DockZone. 
Tags
Dock
Asked by
luca bongioanni
Top achievements
Rank 1
Answers by
Petya
Telerik team
luca bongioanni
Top achievements
Rank 1
Colin Bull
Top achievements
Rank 1
Valeri Hristov
Telerik team
Brian Drought
Top achievements
Rank 1
alexta
Top achievements
Rank 1
lchesnais
Top achievements
Rank 1
BSolveIT
Top achievements
Rank 2
Tsvetie
Telerik team
Rick Aberle
Top achievements
Rank 1
Share this question
or