[CLOSED] KeyMap Error MVC2

  1. #1

    [CLOSED] KeyMap Error MVC2

    Good Day Guys,

    I am getting the error "The control 'btnLogin' does not have an DirectEvent with the name 'Click' or the handler is absent". You guys have any idea what might be causing this.



    <ext:Window 
            ID="windowLogin"
            runat="server" 
            Closable="false"
            Resizable="false"
            Height="195" 
            Icon="Lock" 
            Title= "<%$ Resources:WebResources|Security.FormLabels, ControlsLoginText %>"
            Draggable="true"
            Width="300"
            Modal="true"
            Layout="fit"
            BodyBorder="false"
            LabelAlign="Top"
            Padding="5">        
            <Items>
    
                    <ext:FormPanel ID="fpLogin" 
                        runat="server" 
                        FormID="formLogin"
                        Border="false"
                        Layout="form"
                        BodyBorder="false" 
                        BodyStyle="background:transparent;" 
                        LabelAlign ="Top"
                        >
                        <Items>
                            <ext:TextField 
                                ID="Username" 
                                runat="server" 
                                FieldLabel= "<%$ Resources:WebResources|Security.FormLabels, LabelUsernameText %>"
                                AllowBlank="false"
                                AnchorHorizontal="100%"
                                MsgTarget="Under"
                                Text = '<%# Model.Username %>'
                                AutoDataBind="true"
                                />
                             <ext:TextField 
                                ID="Password" 
                                runat="server" 
                                InputType="Password" 
                                FieldLabel="<%$ Resources:WebResources|Security.FormLabels, LabelPasswordText %>"
                                AllowBlank="false" 
                                AnchorHorizontal="100%"
                                />
                             <ext:HyperLink
                                ID="ForgotPassword" 
                                runat="server"
                                Text= "<%$ Resources:WebResources|Security.FormLabels, HyperLinkForgotYourPasswordText %>"
                                AnchorHorizontal="100%"
                                HideLabel ="true"
                                 />
                        </Items>
                    </ext:FormPanel>
            </Items>
            <Buttons>
                <ext:Button 
                ID="btnLogin" 
                runat="server" 
                Text="<%$ Resources:WebResources|Security.FormLabels, ControlsLoginText %>"
                Icon="Accept">
                    <DirectEvents>
                        <Click 
                            AutoDataBind ="true"
                            Url='<%# Html.GetUrl("Security","Account", "Login") %>'
                            Timeout="60000"
                            FormID="formLogin"
                            CleanRequest="true" 
                            Method="POST"
                            Failure="Ext.Msg.show({
                               title:   result.errorMessage.split(':')[1],
                               msg:     result.errorMessage.split(':')[0],
                               buttons: Ext.Msg.OK,
                               icon:    Ext.MessageBox.Warning
                            });"
                            >
                            <EventMask MinDelay="250" />
                            <ExtraParams>
                                <ext:Parameter Name="ReturnUrl" Value="Ext.urlDecode(String(document.location).split('?')[1]).r || '/'" Mode="Raw" />
                            </ExtraParams>
                        </Click>
                    </DirectEvents>
                </ext:Button>
            </Buttons>
        </ext:Window>
        <ext:KeyMap ID="KeyMap" runat="server" Target="={Ext.isGecko ? Ext.getDoc() : Ext.getBody()}">
            <ext:KeyBinding StopEvent="true">
                <Keys>
                    <ext:Key Code="ENTER" />
                </Keys>
                <Listeners>
                    <Event Handler="btnLogin.fireEvent('click');" />
                </Listeners>
            </ext:KeyBinding>
        </ext:KeyMap>
    Last edited by Daniil; Mar 03, 2011 at 10:05 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please clarify what url is provided by
    Url='<%# Html.GetUrl("Security","Account", "Login") %>'
  3. #3

    Hey

    Hi,

    This URL would return the string "/{cultre}/Security/Account/Login" ( "/en/Security/Account/Login"). This works without a problem until i try adding the keymap.
  4. #4
    Please clarify does DirectEvent work fine when you just click on the button? Does this error appear when it deals with KeyMap only?
  5. #5
    Well, I was trying to reproduce the issue using the code that you provided with no success.

    Please provide a full test sample, which we could copy and run without any changes from our side.
  6. #6

    Hi

    Hi,

    I was doing something incorrectly that caused this issue. Sorry guys.

Similar Threads

  1. [CLOSED] Error when binding KeyMap to not active Panel in TabPanel
    By Fredrik in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 02, 2012, 1:52 PM
  2. how to implement Ext.net in MVC2 asp.et
    By hardik in forum 1.x Help
    Replies: 3
    Last Post: Sep 30, 2011, 11:06 AM
  3. Replies: 1
    Last Post: Feb 22, 2011, 11:25 PM
  4. [CLOSED] ASP.NET MVC2 LogOn
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 21, 2010, 9:30 AM
  5. BorderLayout KeyMap Error
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Dec 17, 2009, 8:18 AM

Posting Permissions