[CLOSED] Event handler before direct event handlers

  1. #1

    [CLOSED] Event handler before direct event handlers

    I have custom control, which has some kind of "dynamic" content. On control I have several direct events as handler on toolbar buttons.
    Is there any method/event handler to override on control, which is fired BEFORE direct events (so before RaisePostbackEvent...) and AFTER the state of controls (for example my toolbar buttons) are restored.
    I tryed to override OnLoad method on control, but it looks that it's too early becouse state of controls is not restored yet.

    Resume: Inside direct event handler I get correct state, but I want to call some code before direct event code execute. I can do it "manualy" in all event handlers ... but question is is it possible to call it before any/all direct event on control fires?

    Thanks for reply

    Matej
    Last edited by Daniil; Jul 06, 2011 at 1:58 PM. Reason: [CLOSED]
  2. #2
    Hi,
    which is fired BEFORE direct events (so before RaisePostbackEvent...)
    DirectEvent is not raised in the RaisePostbackEvent method, DirectEvent is an ajax request.

    Each DirectEvent has client side Before handler. But not sure it will suite your needs.

    Please clarify what exactly actions you'd like to execute before DirectEvent?

    Generally speaking, there is no server side Before DirectEvent handler.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Generally speaking, there is no server side Before DirectEvent handler.
    Thanks!

    Matej
  4. #4
    Quote Originally Posted by Daniil View Post
    Hi,


    DirectEvent is not raised in the RaisePostbackEvent method, DirectEvent is an ajax request.

    Each DirectEvent has client side Before handler. But not sure it will suite your needs.

    Please clarify what exactly actions you'd like to execute before DirectEvent?

    Generally speaking, there is no server side Before DirectEvent handler.
    I am just wondering why I cant get key value on "BEFORE"
    for example
     <ext:NumberField EnableKeyEvents="true"  runat="server"     Width="150" >
        <DirectEvents>
             <KeyPress OnEvent="some_server_method" Before="submit_after_enter_key_is_pressed" ></KeyPress>
         </DirectEvents>
     </ext:NumberField>
    function submit_after_enter_key_is_pressed() {
    argument[0] // the control which has an direct event
    arguments[1] // just displays  "event"
    arguments[2]// just displays "KeyPress"
    arguments[3] // empty object {...}
    arguments[4] // request itself
    // but where is the key EVENT ??????????????????????????????????????
    }


    How can i validate a directevent on keypress ???????????????????????????????
  5. #5
    Hi,

    Please start a new forum thread. If you feel the threads are related, please feel free to cross-link between the two.

Similar Threads

  1. Replies: 5
    Last Post: Jun 25, 2012, 7:19 PM
  2. Replies: 3
    Last Post: Oct 14, 2011, 6:05 AM
  3. Replies: 13
    Last Post: Jul 29, 2011, 5:24 AM
  4. Replies: 3
    Last Post: Apr 20, 2010, 1:21 PM
  5. Replies: 21
    Last Post: Jan 14, 2010, 2:18 PM

Posting Permissions