[CLOSED] How to Call an event by Direct Events

  1. #1

    [CLOSED] How to Call an event by Direct Events

    Hi,

    I'd like to call a direct event after leave some field. I'm doing this using the "Change OnEvent" but it is called by each caracter entered by the user and I want to call only when the field lost the focus.

    Please help me to change to correct method.

    My code:

    <ext:TextField ID="txtUsername" runat="server" ReadOnly="false" FieldLabel="User"
                                    AllowBlank="false" Text="" LabelAlign="Right">
                                    <DirectEvents>
                                        <Change OnEvent="posicionarEmpresa" />
                                    </DirectEvents>                                
                                </ext:TextField>
    Code in CS:

        public void posicionarEmpresa(object sender, DirectEventArgs e)
        {
            var lista = from f in dc.Empresas
                        join x in dc.UsuarioEmpresas on f.nCdEmpresa equals x.nCdEmpresa
                        join u in dc.Usuarios on x.nCdUsuario equals u.nCdUsuario
                        where u.cNmLogin == this.txtUsername.Text
                        orderby f.cNmEmpresa
                        select new
                        {
                            f.nCdEmpresa,
                            f.cNmEmpresa
                        };
    
            this.StoreEmpresa.DataSource = lista;
            this.StoreEmpresa.DataBind();
        }
    Thanks in advance,

    Oliver
    Last edited by geoffrey.mcgill; Jun 12, 2012 at 6:34 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use the Blur DirectEvent.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Please use the Blur DirectEvent.
    Hi Daniil,

    Thanks for the reply, it works!!


    Oliver

Similar Threads

  1. [CLOSED] Output Cache issue with Direct Method / Direct Event
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Mar 01, 2013, 5:03 AM
  2. Direct Events with Razor
    By gdog_5021 in forum 2.x Help
    Replies: 3
    Last Post: Aug 15, 2012, 10:46 AM
  3. [CLOSED] Problem with Direct event call on cell commands
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: Apr 26, 2012, 7:49 AM
  4. Replies: 6
    Last Post: Dec 14, 2011, 5:24 AM
  5. Replies: 3
    Last Post: Apr 20, 2010, 12:21 PM

Posting Permissions