[CLOSED] Creating ext:Window in CodeBehind.Button aligment

  1. #1

    [CLOSED] Creating ext:Window in CodeBehind.Button aligment

    Hi! I'm creating a ext:window in codebehind and this window has two buttons: Ok and Cancel...

    In first time that the ext:window is created, the 'Ok' button is set to center align (this is correct)
    But the other times that the ext:window is created, the 'Ok' button is aligned to left...

    Follow below a test page to exemplify my problem:

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test23.aspx.vb" Inherits="WebApplication3.Test23" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" 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 Sub AddWindow(sender As Object, evt As Ext.Net.DirectEventArgs)
            Dim wnd As Ext.Net.Window
            wnd = getWindow()
            Me.Form.Controls.Add(wnd)
            wnd.Render()
            wnd.Show()
        End Sub
        
        Protected Function getWindow(Optional url As String = "~/test22.aspx", Optional pTitle As String = "test", Optional iconUrl As String = "") As Ext.Net.Window
            Dim wnd As New Ext.Net.Window
            Dim loader As New Ext.Net.ComponentLoader
            Dim btn As Ext.Net.Button
    
            loader.Url = url
            loader.Mode = Ext.Net.LoadMode.Frame
            loader.LoadMask.ShowMask = True
            loader.LoadMask.Msg = "Carregando..."
    
            wnd.ID = "window_" & (New System.Random).Next(Integer.MaxValue).ToString
            wnd.Title = pTitle
            If iconUrl <> "" Then
            Else
                wnd.Icon = Ext.Net.Icon.ApplicationForm
            End If
            wnd.AutoRender = False
            wnd.Collapsible = False
            wnd.Hidden = True
            wnd.AutoRender = False
            wnd.Maximizable = False
            wnd.Loader = loader
    
            btn = New Ext.Net.Button
            btn.ID = "btnOk"
            btn.Text = "Ok"
            btn.TextAlign = ButtonTextAlign.Center
            btn.Icon = Icon.Accept
            'btn.OnClientClick = wnd.ClientID & ".getBody().Ext.net.DirectMethods.SaveRecord();"
            wnd.Buttons.Add(btn)
            
            btn = New Ext.Net.Button
            btn.ID = "btnCancel"
            btn.Text = "Cancel"
            btn.TextAlign=ButtonTextAlign.Center 
            btn.Icon = Icon.Cancel
            btn.OnClientClick = wnd.ClientID & ".close();"
            wnd.Buttons.Add(btn)
            
            Return wnd
    
        End Function
        
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <ext:ResourceManager ID="resManagerSGCO" runat="server" Namespace="SuperaWeb.SGCO" /> 
        <form id="form1" runat="server">
        <div>
            <ext:Button runat="server" ID="btnCreateWindow" Text="Create and Show Window" OnDirectClick="addWindow" />
        </div>
        </form>
    </body>
    </html>
    Last edited by Daniil; Mar 09, 2012 at 10:15 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Did you close the window before open new windows?
  3. #3
    Hi,

    Please try to set up:
    wnd.CloseAction = CloseAction.Destroy
  4. #4
    Hi Daniil!

    Solved!

    Thanks a lot!

Similar Threads

  1. [CLOSED] Creating Combobox + Store in CodeBehind
    By trezv in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 12, 2015, 1:41 PM
  2. [CLOSED] Creating and Show ext.Window in CodeBehind
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 08, 2012, 3:31 PM
  3. [CLOSED] Creating DirectEvent from codebehind
    By krzak in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 01, 2011, 10:17 AM
  4. Creating a Store From CodeBehind
    By ahmetmeral in forum 1.x Help
    Replies: 5
    Last Post: Dec 14, 2008, 5:14 PM
  5. Creating a delux portal from codebehind.
    By prashobkumar in forum 1.x Help
    Replies: 1
    Last Post: Dec 09, 2008, 11:36 AM

Posting Permissions