Problem opening dynamically created window from within an existing window.

  1. #1

    Problem opening dynamically created window from within an existing window.

    Hi,

    This is my senario.

    I have a aspx page called default.aspx and in this page i have a placeholder control that i used to dynamically load the window control to.

    
    
    
    Public Sub Form(ByVal ID As String, _
    ByVal Title As String, _
    ByVal Page As String, _
    ByVal Width As Integer, ByVal Height As Integer, _
    ByVal PlaceHolder1 As PlaceHolder, _
    ByVal ControlID As String, _
    Optional ByVal Modal As Boolean = False, _
    Optional ByVal Maximizable As Boolean = True, _
    Optional ByVal Minimizable As Boolean = True, _
    Optional ByVal Resizable As Boolean = True)
    Dim newWin As New Coolite.Web.UI.Window
    Dim maximize As ClientEvent = New ClientEvent
    maximize.Handler = "function (el){ var view = Ext.getBody().getViewSize(); el.setSize(view.width, view.height); }"
    With newWin
        .ID = ID
        .Title = Title
        .Width = Unit.Pixel(Width)
        .Height = Unit.Pixel(Height)
        .AutoLoad = Page
        .Minimizable = Maximizable
        .Maximizable = Minimizable
        .Collapsible = True
        .ClientEvents.Maximize = maximize
        .Modal = Modal
        .Resizable = Resizable
        .CloseAction = CloseAction.Hide
        .AnimateTarget = ControlID
        .Show()
    End With
        PlaceHolder1.Controls.Add(newWin)
    End Sub
    My problem arises when i want to open another window from the previously created window. But i dont want to open it within that window but i want to load to open it in in my default.aspx page.

    I hope im making sense here but this is actually want but somehow i cant seem to do it.

    Is this actually possible.

    Thanks in advance.
  2. #2

    RE: Problem opening dynamically created window from within an existing window.

    Hi sashe,

    I apologize but I don't think I understand what you need to do. Can you expain further?

    Here's a full code sample demonstrating how to dynamically create a new <ext:Window> on a hard PostBack.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register 
        assembly="Coolite.Ext.Web" 
        namespace="Coolite.Ext.Web" 
        tagprefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Button1_Click(object sender, EventArgs e)
        {
            Window win = new Window();
            win.Title = "A New Window!";
            win.Html = "I am special!";
            win.BodyStyle = "padding: 6px;";
    
            this.form1.Controls.Add(win);       
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Create a new Window</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ScriptManager ID="ScriptManager1" runat="server" />
        <ext:Window 
            ID="Window1" 
            runat="server" 
            Collapsible="true"
            BodyStyle="padding: 6px;" 
            Height="150" 
            Width="300">
            <Content>
                <ext:Button 
                    ID="Button1" 
                    runat="server" 
                    Text="Create another Window" 
                    Icon="ApplicationCascade" 
                    &#111;nclick="Button1_Click" />
            </Content>
        </ext:Window>
        </form>
    </body>
    </html>
    Geoffrey McGill
    Founder
  3. #3

    RE: Problem opening dynamically created window from within an existing window.

    Hi,

    Ive attached a visual diagram of what i actually want... hope that you help explain my problem.

    Sorry for not being clearer..

    Also is it possible to get the Build 5.0 for testin purposes?

    Thanks in advance.

    Regards,
    Sashekumar
  4. #4

    RE: Problem opening dynamically created window from within an existing window.

    Hi Sashekumar,

    Thanks for the image. I'll take a look and see what I can do.

    You can download v0.5 from the following location.

    http://www.ext.net/download/
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 5
    Last Post: Aug 07, 2012, 12:07 AM
  2. Replies: 8
    Last Post: Mar 13, 2012, 5:54 PM
  3. [CLOSED] Problem opening a popoup window
    By sisa in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 15, 2011, 12:31 PM
  4. [CLOSED] Problem opening a Window that contains UserControl
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 26, 2011, 3:42 AM
  5. [CLOSED] [1.0] Dynamically created control problem
    By galeb in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Aug 19, 2010, 7:16 AM

Posting Permissions