Problem Calling DirectEvent

  1. #1

    Problem Calling DirectEvent

    Hello

    I have a problem to call DirectEvent from Dynamic Window I created. Im using 1.3

    See the Code:

    This is de default.aspx code:
    <form id="frmMain" runat="server">
            <ext:ResourceManager ID="rsmMain" runat="server" ViewStateMode="Disabled" ScriptMode="Debug" Theme="Gray" DisableViewState="True" EnableViewState="False">
            </ext:ResourceManager>
                                    <ext:Button ID="btnNewInvoice" runat="server" Text="Create Invoice" Flat="True">
                                        <DirectEvents>
                                            <Click OnEvent="btnNewInvoice_Click">
                                            </Click>
                                        </DirectEvents>
                                    </ext:Button>
    </form>
    This DirectEvent from default.aspx calls the dynamic window:
    protected void btnNewInvoice_Click(object sender, DirectEventArgs e)
    {
    controls.InvoiceNew myInoice = new controls.InvoiceNew();
    myInoice.Render(this.frmMain, RenderMode.Auto); 
    myInoice = null;
    }
    This Is the InvoiceNew Partial Class (Define Control Properties):
    public partial class InvoiceNew : Window 
        {
            private FormPanel formPanel;
            private Button btnCreate;
    
            public InvoiceNew()
            {
                this.BuildFormPanel();
                this.InitLogic();
            }
    
            private void BuildFormPanel()
            {
    
                this.btnCreate = new Button
                {
                    ID = "btnCreateNew",
                    Flat = true,
                    Text = "Create invoice",
                    Icon = Ext.Net.Icon.Accept
                };
    
                this.formPanel = new FormPanel
                 {
                     Region = Ext.Net.Region.Center,
                     LabelWidth = 100,
                     ButtonAlign = Alignment.Right,
                     MinButtonWidth = 80,
                     BaseCls = "x-plain",
                     RenderFormElement = false,
                     MonitorValid = true,
                     CustomConfig =
                     {
                         new ConfigItem("margins", "10 10 5 10", ParameterMode.Value)
                     },
                     Buttons =
                     {
                         btnCreate
                     }
                 };
    
                this.Items.Add(this.formPanel);
            }            
        }
    This Class have the InitLogic That will have the events of the window
    public partial class InvoiceNew
        {
            private void InitLogic()
            {
                ComponentDirectEvent CreateClick = this.btnCreate.DirectEvents.Click;
                CreateClick.Event += new ComponentDirectEvent.DirectEventHandler(CreateClick_Event);
                CreateClick.EventMask.Msg = "Please Wait...";
                CreateClick.EventMask.MinDelay = 10;            
            }
    
            void CreateClick_Event(object sender, DirectEventArgs e)
            {
               //Run This Code :) 
            }
    
        }
  2. #2

Similar Threads

  1. ColorPicker DirectEvent Problem
    By nagesh in forum 1.x Help
    Replies: 1
    Last Post: Jul 12, 2012, 6:34 AM
  2. Replies: 3
    Last Post: Dec 28, 2011, 5:46 PM
  3. [CLOSED] Problem when calling reconfigure for gridpanel using borderlayout
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 05, 2011, 1:26 PM
  4. Replies: 2
    Last Post: Apr 09, 2010, 11:28 AM
  5. Problem calling methods
    By Argons in forum 1.x Help
    Replies: 5
    Last Post: Aug 03, 2009, 2:04 AM

Posting Permissions