[CLOSED] GridPanel Editor Listeners Not Fired and Values Not Passed

  1. #1

    [CLOSED] GridPanel Editor Listeners Not Fired and Values Not Passed

    Dears,

    What I want to achieve is the following:

    1. Click "add new row" to the GridPanel, and the row will be inserted at the top and first field will be focused.
    2. The user will start filling the fist column i.e. 123.
    3. After the user click Tab button, and the focus moved to the next field, I want to call behind code method to retrieve information from database based on user input i.e. 123 if available and auto-fill the editor fields.

    This is what I did:

    <ext:Column runat="server" Align="Center" Width="110" Text="CPR" DataIndex="CPR_NO" >
        <Filter>
            <ext:StringFilter />
        </Filter>
        <Editor>
            <ext:TextField ID="txtEditCPR" ClientIDMode="Static" runat="server" >
                <Listeners>
                   <Tab Handler="#{DirectMethods}.autoFillFromCPRMaster();"></Tab> 
                </Listeners>
            </ext:TextField>
        </Editor>
    </ext:Column>
    The event does not work as expected, and some events get fired, but when I try to get the value entered by the user, it always return blank.

        <DirectMethod> _
        Function autoFillFromCPRMaster() As Boolean
            Dim searchCPR As String = txtEditCPR.Text.Trim
    
            Return True
        End Function
    Kindly, I need your support.

    Regards,
    Alaswad
    Last edited by Daniil; Jan 27, 2016 at 9:42 AM. Reason: [CLOSED]
  2. #2
    Hello!

    First of all, thanks for helping keep separate subjects in different threads. We really appreciate it. It makes life easier searching for solutions on forums.

    This problem you are having seems to be a problem many users have once. And there's a long long explanation for it. I believe we should make a FAQ or blog post about it. :)

    Here is the most recent discussion about this same problem:
    Hidden controls not responding to directevent actions

    When you read that, you'll realize that, that is not really a problem, but a concept, and maybe an ASP.NET limitation, not Ext.NET, actually. It also allows not wasting time/resources on the page by passing all data from client to server on every postback.

    And to overcome that issue, you have to tell code behind the value of what you want to check. You have to pass the values to the code behind function, base your code on this example: DirectMethod Overview.

    In short, code behind does not know you changed a value in a field after the page is loaded and served. You changed that in JavaScript, on your client. The server can't know about this... unless you tell it that. :)

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Store's listeners fired many times
    By mhd in forum 2.x Help
    Replies: 0
    Last Post: Aug 04, 2014, 5:01 PM
  2. Replies: 3
    Last Post: Dec 21, 2012, 10:53 AM
  3. Values in Gridpanel Editor Textfield
    By Anburaja in forum 1.x Help
    Replies: 2
    Last Post: Oct 13, 2012, 3:51 AM
  4. [CLOSED] How to Get Values From Column Editor in GridPanel?
    By tlfdesarrollo in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 03, 2012, 9:54 PM
  5. [CLOSED] GridPanel ComboBox Editor with different values per row
    By logicspeak in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 16, 2011, 6:27 AM

Posting Permissions