[CLOSED] [1.0] Issue with success property on direct event of textfield

  1. #1

    [CLOSED] [1.0] Issue with success property on direct event of textfield



    Hi,

    We have a page in our site where there is a DirectEvent attached to on the change of a TextField. When this is used the page renders a <raw> tag inside the javascript response causing the page to throw a js error.

    Here is a sample page and a sample result from the dynamic js of that page

    Thanks!



    ***RESPONSE***
        Ext.onReady(function(){Ext.QuickTips.init();new Ext.form.TextField({
      id: "txtGroupName",
      cls: "Required",
      disabled: true,
      renderTo: "txtGroupName_Container",
      width: 425,
      autoCreate: {"tag":"input","type":"text","maxlength":100,"autocomplete":"off"},
      allowBlank: false,
      maxLength: 100,
      directEvents: {
      change: {fn:function(el,newValue,oldValue){var params=arguments;Ext.net.DirectEvent.confirmRequest({
      formProxyArg: "form1",
      userSuccess: function(response, result, el, type, action, extraParams){<raw>Ext.get('ctl00_Content_btnSaveGroup').dom.disabled=false;},
      control:this,action:'Change'});},delay:20}
    }

    <%@ Page Language="C#" EnableEventValidation="false" %></p>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head id="Head1" runat="server">
        <title>Example of disappearing checkbox</title>
    </head></p>
    
    
    <script runat="server">
            protected void txtGroupName_Changed(object sender, DirectEventArgs e)
            {</p>
    
    
            }
            
            protected void btnSaveGroup_Click(object sender, EventArgs e)
            {</p>
    
    
            }</p>
    
    
    </script></p>
    
    
    <body>
        <form id="form1" runat="server">
        
            <ext:ResourceManager runat="server" ID="extResourceManager" SourceFormatting="true">
            </ext:ResourceManager>
            
                
                            <ext:TextField ID="txtGroupName" runat="server" 
                                AllowBlank="false" 
                                Width="425" 
                                MaxLength="100" 
                                Cls="Required"
                                Disabled="true" 
                                SkinID="RequiredTextBox">
                                <DirectEvents>
                                    <Change OnEvent="txtGroupName_Changed" Success="Ext.get('ctl00_Content_btnSaveGroup').dom.disabled=false;" />
                                </DirectEvents>
                            </ext:TextField>
               
                            <asp:Button ID="btnSaveGroup" runat="server" Text="Save Changes" &#111;nclick="btnSaveGroup_Click" Enabled="false" />
        
    
        </form>
    </body>
    </html>
    </p>
  2. #2

    RE: [CLOSED] [1.0] Issue with success property on direct event of textfield

    Hi bryantharpe,

    Yes, there is a parsing issue. Thanks for pointing out this defect.


    As a temp fix, just a single semi-colon ( ; ) to the start of the Success handler.


    Example


    Success=";Ext.get...

    I'll keep this thread updated.


    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] [1.0] Issue with success property on direct event of textfield

    ok, a fix has been committed to svn.

    Your original code sample should work correctly now.


    Geoffrey McGill
    Founder
  4. #4

    RE: [CLOSED] [1.0] Issue with success property on direct event of textfield

    woohoo! thanks! pulling latest. The other workaround worked as well but i'll go ahead and remove that now.
  5. #5

    RE: [CLOSED] [1.0] Issue with success property on direct event of textfield

    As a side note, you should be able to use the #{} id/get token instead of hard coding the "Ext.get" script in your Success handler.

    The following sample demonstrates and it should work for you after svn update.


    Example


    Success="#{ctl00_Content_btnSaveGroup}.dom.disabled=false;"


    You should even be able to reduce to the following, but would just depend on how your page/usercontrol is structured.


    Example


    Success="#{btnSaveGroup}.set({'disabled':true});"

    Geoffrey McGill
    Founder
  6. #6

    RE: [CLOSED] [1.0] Issue with success property on direct event of textfield

    Thanks for pointing that out. We had actually started with #{} syntax but removed it to be sure that wasnt causing the rendering issues.

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. RowDblClick Direct Event Issue
    By sumesh in forum 1.x Help
    Replies: 5
    Last Post: May 01, 2012, 11:15 AM
  3. Replies: 2
    Last Post: Jan 25, 2012, 3:18 PM
  4. [CLOSED] Button Issue Direct Event (IE6-IE7-IE8)
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Nov 10, 2011, 6:23 AM
  5. Replies: 7
    Last Post: Nov 25, 2010, 4:18 PM

Posting Permissions