Feb 24, 2015, 1:52 AM
[CLOSED] SpecialKey doesn't work good with ENTER key
Hello Team, I have a issue with a TextField:
I have a DirectEvent in the TextField with SpecialKey and I try to call one function in OnEvent when the ENTER key is pressed, but it doesn't works in he first time, but when I pressed ENTER 2 or 3 times it works. Can you suggest me any solution? Here is my example code and screenshot, thanks team
I have a DirectEvent in the TextField with SpecialKey and I try to call one function in OnEvent when the ENTER key is pressed, but it doesn't works in he first time, but when I pressed ENTER 2 or 3 times it works. Can you suggest me any solution? Here is my example code and screenshot, thanks team
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="texfieldkey.aspx.cs" Inherits="OSEF.ERP.APP.texfieldkey" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:ResourceManager ID="ResourceManager1" runat="server">
</ext:ResourceManager>
<ext:TextField
ID="txtTest"
runat="server"
AutoFocus="true">
<DirectEvents>
<SpecialKey
Before="return e.getKey() == Ext.EventObject.ENTER"
OnEvent="txtfEnviarCorreo_SpecialKey">
</SpecialKey>
</DirectEvents>
</ext:TextField>
<ext:Label ID="lblTest" runat="server" Text="Here">
</ext:Label>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
namespace OSEF.ERP.APP
{
public partial class texfieldkey : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void txtfEnviarCorreo_SpecialKey(object sender, DirectEventArgs e)
{
lblTest.Text = "Here Works My Event";
}
}
}
Last edited by fabricio.murta; Feb 24, 2015 at 7:39 PM.
Reason: [CLOSED]