[CLOSED] Cant clean Textfield after Keymap

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Cant clean Textfield after Keymap

    Hi,

    I,ve been trying to clean a Textfield after a KeyMap but It is not working. However if i do the same, from a Button with a Directevent it works perfect.

    Here is an example of my code:
    <%@ Page Title="Fabricacion Jhayber" Language="C#" AutoEventWireup="true" CodeBehind="LecturaNota.aspx.cs" Inherits="Fabricacion.LecturaNota" %>
    <%@ 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">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
     
    
    <head runat="server" >
        <title>Fabricacion Jhayber</title>
    <script type="text/javascript">
            var Alerta = function (keyCode, e) {
    
                App.direct.LecturaCodeBar();
            };
    
        </script>
    
    </head>
    <body>
        
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />           
            <ext:Panel ID="Panel1" runat="server">
            <Content>
                <ext:Window ID="Window1" runat="server" Closable="false" Resizable="false"
                Draggable="false" Modal="true"
                BodyPadding="5" Layout="columnlayout" cls="Windownotas" Width ="400" Hidden="false ">
                    <Items>
                          <ext:Panel ID="PanelPrincipal" runat="server" AnchorHorizontal="100%"
                                Title="Lectura Nota" Margins="5" Padding="5" Region="Center" AnchorVertical="100%" Layout="FormLayout">
                                <Items>
                                    <ext:FieldContainer ID="Codebarfield" runat="server" Layout="HBoxLayout" AnchorHorizontal="100%" >
                                        <items>
                                            <ext:FieldSet ID="FieldSet1" runat="server" width="360" Title="Código Nota Terminado" MarginSpec="0 0 0 0">
                                                <Defaults>
                                                    <ext:Parameter Name="LabelWidth" Value="50" />
                                                </Defaults>
                                                <Items>
                                                    <ext:TextField ID="CodebarText" runat="server" FieldLabel="Código" width="300"/>
                                                </Items>                    
                                            </ext:FieldSet>
                                        </items>
                                    </ext:FieldContainer>
    
                                </Items>
                            </ext:Panel>         
                    </Items>
                    <Buttons>
                        <ext:Button runat="server" >
                            <DirectEvents>
                                <Click OnEvent="TestText"></Click>
                            </DirectEvents>
                        </ext:Button>
                    </Buttons>
             </ext:Window>
    
            <ext:KeyMap runat="server" Target="={Ext.getBody()}">
                <Binding>
                    <ext:KeyBinding Handler="Alerta" >
                        <Keys>
                            <ext:Key Code="ENTER" />
                        </Keys>
                    </ext:KeyBinding>
                </Binding>
            </ext:KeyMap>
             </Content>
            </ext:Panel>
        </form>
    </body>
    </html>
    using System;
    using System.Collections.Generic;
    using Persistencia.Dto;
    using Persistencia.Dao;
    using System.Data.SqlClient;
    using System.Diagnostics;
    using Negocio;
    using System.Configuration;
    using Ext.Net;
    
    
    namespace Fabricacion
    {
        public partial class LecturaNota : System.Web.UI.Page
        {                
            protected void Page_Load(object sender, EventArgs e)
            {
    
                
    
            }
    
            [DirectMethod]
            public void LecturaCodeBar()
            {
                CodebarText.Text = "";
              
            }
    
            protected void TestText(object sender, EventArgs e)
            {
                CodebarText.Text = "";
            }
    
        }
    }
    Is there any way to do this? Thank You
    Last edited by fabricio.murta; Dec 06, 2018 at 3:18 PM.

Similar Threads

  1. [CLOSED] JS Error if KeyMap target doesnt exist
    By Z in forum 4.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 14, 2017, 4:20 PM
  2. Replies: 6
    Last Post: Sep 04, 2012, 12:59 PM
  3. Replies: 4
    Last Post: Jul 25, 2012, 5:45 AM
  4. [CLOSED] Clean GridPanel
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 18, 2011, 9:10 PM
  5. How to clean (really) a SelectionModel ?
    By eliezer in forum 1.x Help
    Replies: 4
    Last Post: Feb 06, 2009, 2:08 PM

Posting Permissions