In popup window button <DirectEvent> is not working (not Firing)

  1. #1

    In popup window button <DirectEvent> is not working (not Firing)

    Hello Sir,

    i have used Below example
    https://examples2.ext.net/#/Form/Mis.../Contact_Form/
    My code below:
    aspx page code
    <ext:Window ID="Window1"
        runat="server"
        Title="Quick Idea"
        Width="350"
        Height="300"
        MinWidth="250"
        MinHeight="200"
        DefaultFocus="firstName"
        Layout="FitLayout"
        Resizable="true"
        Modal="true"  >
        <Items>
            <ext:FormPanel ID="FormPanel1"
                runat="server"
                Border="false"
                AutoDoLayout="true"
                BodyPadding="10">
    
                <LayoutConfig>
                    <ext:VBoxLayoutConfig Align="Stretch" />
                </LayoutConfig>
    
                <FieldDefaults
                    LabelAlign="Top"
                    LabelWidth="100"
                    LabelStyle="font-weight:bold;" />
    
                <Items>
                    <ext:FieldContainer ID="FieldContainer1"
                        runat="server"
                        FieldLabel=""
                        LabelStyle="font-weight:bold;padding:0;"
                        Layout="HBoxLayout">
    
                        <FieldDefaults LabelAlign="Top" />
    
                        <Items>
                            <ext:TextField ID="txtName"
                                runat="server"
                                Flex="1"
                                Name="firstName"
                                ItemID="firstName"
                                FieldLabel="Name"
                                AllowBlank="false">
                                <AfterLabelTextTpl>
                                    <Html>
                                        <span style="color: red; font-weight: bold" data-qtip="Required">*</span>
                                    </Html>
                                </AfterLabelTextTpl>
                            </ext:TextField>
    
                        </Items>
                    </ext:FieldContainer>
    
                    <ext:TextField ID="txtEmail"
                        runat="server"
                        FieldLabel="Email ID"
                        Vtype="email"
                        AllowBlank="false">
                        <AfterLabelTextTpl>
                            <Html>
                                <span style="color: red; font-weight: bold" data-qtip="Required">*</span>
                            </Html>
                        </AfterLabelTextTpl>
                    </ext:TextField>
    
                    <ext:TextField ID="txtPhone"
                        runat="server"
                        Note="(999) 999-9999"
                        FieldLabel="Phone"
                        AllowBlank="false">
                        <Plugins>
                            <ext:InputMask ID="InputMask1" runat="server" Mask="(999) 999-9999" UnmaskOnBlur="true" />
                        </Plugins>
                        <AfterLabelTextTpl>
                            <Html>
                                <span style="color: red; font-weight: bold" data-qtip="Required">*</span>
                            </Html>
                        </AfterLabelTextTpl>
                    </ext:TextField>
    
                    <ext:TextArea ID="txtIdea"
                        runat="server"
                        FieldLabel="Idea"
                        LabelAlign="Top"
                        Flex="1"
                        Margins="0"
                        AllowBlank="false">
                        <AfterLabelTextTpl>
                            <Html>
                                <span style="color: red; font-weight: bold" data-qtip="Required">*</span>
                            </Html>
                        </AfterLabelTextTpl>
                    </ext:TextArea>
                </Items>
                <Buttons>
                    <ext:Button ID="Button1"
                        runat="server"
                        Text="Cancel">
                        <Listeners>
                            <Click Handler="this.up('form').getForm().reset(); this.up('window').hide();" />
                        </Listeners>
                    </ext:Button>
                    <ext:Button ID="Button2"
                        runat="server"
                        Text="Send" >
                        <DirectEvents>
                            <Click OnEvent="QuickSend">
    
                            </Click>
                        </DirectEvents>
                    </ext:Button>
                </Buttons>
    
            </ext:FormPanel>
        </Items>
    
    </ext:Window>
    aspx.cs file code
     
     protected void Page_Load(object sender, EventArgs e)
            {
             
    
            }
    
            protected void QuickSend(object sender, DirectEventArgs e)
            {
    
            }
    I am getting following error when I click on Button2 to submit data.
    The control with ID 'Button2' not found

    please check this screen shot
    Click image for larger version. 

Name:	Popupimage.png 
Views:	20 
Size:	41.9 KB 
ID:	6391

    Please give some hint.
  2. #2
    Hi @kavit,

    I guess you render that Window dynamically (probably, as a user control), don't you?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @kavit,

    I guess you render that Window dynamically (probably, as a user control), don't you?
    yes I am same as below example
    https://examples2.ext.net/#/Form/Mis.../Contact_Form/
    Last edited by kavit@bdtpark.com; Jun 17, 2013 at 12:05 PM.
  4. #4
    To use a user control's DirectEvents and DirectMethod that user control must be recreated on each request. For more details, please follow:
    DirectMethod from inside Dynamic User Control
  5. #5
    Quote Originally Posted by Daniil View Post
    To use a user control's DirectEvents and DirectMethod that user control must be recreated on each request. For more details, please follow:
    DirectMethod from inside Dynamic User Control

    @Daniil you are suggesting as below:
    in below link
    http://forums.ext.net/showthread.php...l=1#post102596

    Quote Originally Posted by Daniil View Post
    Hello,

    ComponentLoader doesn't maintain a loaded user control during other requests.

    But to execute a user control's DirectMethod handler, a user control instance must be on a server. Otherwise, no a user control => no a DirectMethod handler.

    Personally, I would refer a generic handler (ASHX) or a web service (ASMX). This call won't require a user control instance.
    But I dont know how to do this....
  6. #6

Similar Threads

  1. Replies: 18
    Last Post: Jul 12, 2012, 6:36 AM
  2. DirectEvent of TextField is not Firing...
    By nagesh in forum 1.x Help
    Replies: 0
    Last Post: Jun 20, 2012, 1:22 PM
  3. RowSelectionModel DirectEvent Not Firing
    By collegeminer in forum 2.x Help
    Replies: 1
    Last Post: May 30, 2012, 2:22 PM
  4. [CLOSED] Button event is not firing in parent window from popup window
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 14, 2011, 7:35 PM
  5. [1.0] reload is not working in popup window
    By thiefo in forum 1.x Help
    Replies: 1
    Last Post: Jun 08, 2010, 9:14 AM

Tags for this Thread

Posting Permissions