PDA

View Full Version : window.Show



MrMp3
Apr 21, 2008, 3:52 PM
Hi, when a execute Window1.Show from server side, for example:


Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Window1.Show()
End Sub


The Window position is on right side of the screen. why? is not the same as if i set TriggerElement="Button1"

Thanks
Ariel

geoffrey.mcgill
Apr 22, 2008, 2:30 AM
Any chance you can provide a full code sample demonstrating this issue?

There was a bug with the Window positioning that was affected by the containing <form> dimensions, and I suspect the work-around proposed in the following thread may help solve the problem.

http://forums.ext.net/showthread.php?threadid=290-5-1.aspx

MrMp3
Apr 22, 2008, 12:15 PM
This my code:



<form id="form1" runat="server">
<cool:ScriptManager ID="ScriptManager1" runat="server" />

<h1>
Window with nested Panel</h1>
<p>
The following example demonstrates how to create a Window with nested controls and
content.</p>
<div style="margin: 15px 0;">
<p>
<asp:Button ID="Button1" runat="server" Text="Show Window" /></p>
<p>
<asp:Button ID="Button2" runat="server" Text="Show Window1" /></p>




<cool:Window ID="Window1" runat="server" Title="Vacation Details" Width="400px" Height="630px"
BodyStyle="padding: 6px;" CloseAction="Hide" Collapsible="True" TriggerElement="Button1"
AnimateTarget="Button1">
<Content>
<cool:FieldSet ID="FieldSet1" runat="server" Title="Schedule" Collapsible="True">
<Content>
<div style="margin-bottom: 6px;">
Departure Date:

<cool:Calendar ID="Calendar1" runat="server">
<ClientEvents>
<Select Handler="message" />
</ClientEvents>
</cool:Calendar>
</Content>
</cool:FieldSet>
<cool:Panel ID="Panel1" runat="server" Title="Summary" Height="125px" BodyStyle="padding: 6px;"
Collapsible="True">
<Content>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</Content>
</cool:Panel>
</Content>
</cool:Window>
</form>


And the Server-Side Code:


Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Window1.Center = True
Window1.Show()
End Sub


The window appears on top of the screen and then move to the right side and i could see 50% of the windows.
Thanks
Ariel

geoffrey.mcgill
Apr 28, 2008, 4:55 PM
Hi Ariel,

Thanks for the code sample. I was able to reproduce the problem.

It's somehow related to the AnimateTarget property, so as a temp work-around you can set the property to an empty string on postback.

Example


protected void Button2_Click(object sender, EventArgs e)
{
this.Window1.Center = true;
this.Window1.AnimateTarget = string.Empty;
this.Window1.Show();
}

I'm going to try and find the root cause of the problem and incorporate the fix into the next release. I will keep this thread updated.