[CLOSED] Source and Target - Focus events

  1. #1

    [CLOSED] Source and Target - Focus events

    Hi,

    I am busy writing a dynamic event handler for all components on my screen

    This event handler needs to notify my backend server via a direct event if the user has moved from one field to the next and specifically where the user is and where they intend going
    The backend server will them allow the focus change or block it aswell do other things like force updates to the screen etc

    So questions:

    What is the best way to implement this
    a) a blur event linked to every field
    b) a verification event

    2. regardless is there a way for me to determine the target of a blur event in javascript -
    "I need to tell the server at am component 1 and I am trying to go to component 3 - so tell me what what to do"

    Sorry for the complex questions, i am writing a dynamic screen scraper that needs to communicate with a legacy environment

    Thanks

    Mac
    Last edited by Daniil; Oct 29, 2013 at 11:42 AM. Reason: [CLOSED]
  2. #2
    Maybe take a look at the WordWrench sample in the Examples Explorer.

    https://examples2.ext.net/#/Combinat...s/Word_Wrench/

    A ComponentQuery is hooked up to the <DocumentReady> Listener, which adds an event handler to all Fields that match a certain query. This avoids having to add the Listener to each individual Field/Component.

    <ext:ResourceManager runat="server">
        <Listeners>
            <DocumentReady Handler="
                var fields = Ext.ComponentQuery.query('field[autoUpdateData=true], button[autoUpdateData=true]'),
                    i = 0;
    
                for (; i < fields.length; i += 1) {
                    fields[i].on('change', function (item) {
                        App.direct.UpdateData();
                    }, fields[i], { buffer : 500 });
                }" />
        </Listeners>
    </ext:ResourceManager>
    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3
    Hello!

    Quote Originally Posted by macinator View Post
    What is the best way to implement this
    a) a blur event linked to every field
    b) a verification event
    It depends where you create these fields.

    If you create them dynamically on client-side then you can get them using ComponentManager's all property http://docs.sencha.com/extjs/4.2.1/#...r-property-all, then you can bind your handler, which I think should be a DirectMethod due to easier implementation in this case.

    If you create them on server-side you should be able to bind your handler during creating of controls.

    I'm not sure what you mean by verification. Do you mean Remote validation or something else?

    Quote Originally Posted by macinator View Post
    2. regardless is there a way for me to determine the target of a blur event in javascript -
    "I need to tell the server at am component 1 and I am trying to go to component 3 - so tell me what what to do"
    I'm afraid it's not possible but you can listen focus event. Here is some point of that: http://stackoverflow.com/questions/121499

Similar Threads

  1. [CLOSED] Cannot change Target Framework of Ext.net to 4.5
    By michaeld in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Nov 24, 2013, 1:56 PM
  2. Replies: 2
    Last Post: Apr 11, 2013, 9:31 PM
  3. Replies: 2
    Last Post: Feb 01, 2012, 6:56 AM
  4. Replies: 15
    Last Post: Feb 03, 2011, 1:27 PM
  5. Target Query syntex
    By LoreX75 in forum 1.x Help
    Replies: 4
    Last Post: Aug 03, 2009, 3:46 AM

Posting Permissions