PDA

View Full Version : [CLOSED] Panel Loader, LoadContent, UpdateContent issue



michaeld
Nov 26, 2013, 4:56 AM
Could you post a test case?

As for the empty response issue, this code is all you need to reproduce it.


<%@ Page Language="C#" %>

<script runat="server">
protected void Page_Load( object sender, EventArgs e ) {
Panel2.Loader.Params.Add( new Ext.Net.Parameter( "B", "Send B" ) );
}
protected void OnLoad( object sender, DirectEventArgs e ) {
Panel2.Loader.Params.Add( new Ext.Net.Parameter( "A", "Send A" ) );
Panel2.LoadContent();
Panel2.UpdateContent();
X.Msg.Alert( "OnLoad", "Passing Parameter A to Loader" ).Show();
Panel2.Expand();
}</script>

<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Test41b</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<ext:Viewport ID="vp" runat="server" Layout="VBoxLayout">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>

<ext:Panel ID="Accord" runat="server" Border="false" Padding="3" Flex="1" Title="Test41" Layout="Accordion">
<Items>
<ext:Panel ID="Panel1" runat="server" Title="Panel1: Test41a" Flex="1" Layout="VBoxLayout" AutoScroll="true">
<Items>
<ext:Button ID="Button1" runat="server" Text="Test Loader Panel2">
<DirectEvents>
<Click OnEvent="OnLoad" />
</DirectEvents>
</ext:Button>
</Items>
</ext:Panel>
<ext:Panel ID="Panel2" runat="server" Title="Panel2: Loader Container For Test41b" Flex="1" Layout="VBoxLayout" AutoScroll="true">
<Loader ID="Loader1" runat="server" Url="Test41b.aspx" DisableCaching="true" Mode="Frame" AutoLoad="false">
<LoadMask ShowMask="true" />
</Loader>
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
</ext:Panel>

</Items>
</ext:Panel>

</Items>
</ext:Viewport>
</form>
</body>
</html>


Click Test button and look at the response. You'll see that it shows {}. I can think of nothing to justify this behavior. There must be a bug in extnet.

Daniil
Nov 26, 2013, 6:04 AM
This is a fork from:
http://forums.ext.net/showthread.php?27337

Daniil
Nov 26, 2013, 6:29 AM
What is the use-case to call LoadContent and UpdateContent together?

Yes, similar names, but different actions. A LoadContent call triggers loading of Loader, an UpdateContent call re-renders the content. I think it conflicts and should not be used together at all.

michaeld
Nov 26, 2013, 12:39 PM
Can you elaborate on why these should not be used together?

Myself, I'm more curious why it happens. It shouldn't. I provided the test case because it's hard to reproduce and I expect I may run into it again elsewhere as I've seen it before when I've called UpdateContent in other places. This particular use-case may not be the issue, but I've seen the empty response stream issue before but never been able to produce a reliable test-case failure before. If I even change the code around a little or add another control that needs to be rendered in the DirectEvent, it works again. Usually this type of thing leads to clues on other bugs, so that's why I brought the issue to your attention. I thought it deemed further investigation as it was the first time I could, but here again, all I can do is provide the test-case.

I dug a little deeper anyway. When I step through the code, it looks like this...


//public virtual void LoadContent()
this.Call("load", new JRawValue(new ClientConfig().Serialize(this.Loader, true)));
//renders: {"id":"Loader1","autoLoad":false,"loadMask":{"showMask":true},"paramsFn":function(){ return {"B":"Send B","A":"Send A"}; },"renderer":"frame","url":"Test41b.aspx"}
//this goes to ProxyScripts
...
//public virtual void UpdateContent(bool selfRendering)
this.ResourceManager.AddScript(this.ContentToScrip t(selfRendering));
//renders: Ext.suspendLayouts();App.Panel2.removeAll();Ext.re sumeLayouts(true);
//this goes to this.scripts


Both of these render proper outputs, but I don't know where to set a breakpoint where these are constructed into a final render stream. Unless I can do that, I can't tell you if this is just a strange nuance, something that will never been seen again, or it's related to other times I've had the issue.

Daniil
Nov 27, 2013, 10:15 AM
Can you elaborate on why these should not be used together?

Well, they are two different ways to put some content into a container. If you use a container's Items or Content you just put the stuff there. If you use a Loader, a container's content is loaded remotely via some URL.

The LoadContent method deals with a Loader, but the UpdateContent deals with Items and Content.



Usually this type of thing leads to clues on other bugs, so that's why I brought the issue to your attention. I thought it deemed further investigation as it was the first time I could, but here again, all I can do is provide the test-case.


Indeed, we were able to find a bug due to your test case. Thank you. If an UpdateContent method is called on a container without any content, it causes an empty response at all. We are investigating.

michaeld
Nov 27, 2013, 10:27 AM
Indeed, we were able to find a bug due to your test case. Thank you. If an UpdateContent method is called on a container without any content, it causes an empty response at all. We are investigating.

Yep, that's why when it was overlooked because we were talking about many things, I re-brought this to your attention. It may have nothing to do with what I was experiencing in other scenarios or it might. In any case, it was very unsettling, for me at least, that the Alert didn't even make it into the render stream.

Thanks for looking at this.

Daniil
Nov 27, 2013, 3:34 PM
It looks Vladimir was able to fix it. The fix has been committed to the trunk.