[FIXED] [V0.8.0] Bug in Coolite.AjaxEvent

  1. #1

    [FIXED] [V0.8.0] Bug in Coolite.AjaxEvent

    in the beforerequest listener, there's a line that throws an exception:

    o.url = forms[0].dom.action || Coolite.Ext.Url || window.location.href;
    o.url = forms[0].action || Coolite.Ext.Url || window.location.href;
    it should read:

    o.url = forms[0].action || Coolite.Ext.Url || window.location.href; o.url = forms[0].action || Coolite.Ext.Url || window.location.href;
    popped up on Click AjaxEvent on a Button in a GridPanel with Type=Load

  2. #2

    RE: [FIXED] [V0.8.0] Bug in Coolite.AjaxEvent

    Hi abertram,

    Nice find. I'm investigating and will fix immediately.


    Thanks for bringing this to our attention.


    Geoffrey McGill
    Founder
  3. #3

    RE: [FIXED] [V0.8.0] Bug in Coolite.AjaxEvent

    hi

    same here when event click on Button is Type="Load" and form has not action property defined.

    When I execute I have an error in Coolite.axd on forms[0].dom.action : dom is undefined

    if (Ext.isEmpty(o.form) && Ext.isEmpty(o.url)) {
        var forms = Ext.select("form").elements;
    
        if (forms.length > 0) {
            if (o.type == "submit") {
                o.form = Ext.get(forms[0]);
            } else {
                o.url = forms[0].dom.action || Coolite.Ext.Url || window.location.href;
            }
        }
    }
  4. #4

    RE: [FIXED] [V0.8.0] Bug in Coolite.AjaxEvent

    Hi guys,

    Can you post sample code which reproduces the error?

    Here is my test case which works fine:

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head2" runat="server">
        <title></title>
        
        <script runat="server">
            protected void Button1Click(object sender, AjaxEventArgs e)
            {
                Button1.AddScript("alert('clicked');");
            }
        </script>
    </head>
    <body>
        <form>
            <ext:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Debug" />          
             
            <ext:Button ID="Button1" runat="server" Text="AjaxEvent">
                <AjaxEvents>
                    <Click OnEvent="Button1Click" Type="Load"></Click>
                </AjaxEvents>
            </ext:Button>
        </form>
    </body>
    </html>

  5. #5

    RE: [FIXED] [V0.8.0] Bug in Coolite.AjaxEvent

    Hi Vlad,

    I don't quite recall where this cropped up (i've since fixed the js on my end), but i can point out why the error occurs. Take a look at the beforerequest handler of the Coolite.AjaxEvent class, at this block:

    1:*************************** if (Ext.isEmpty(o.form) &amp;&amp; Ext.isEmpty(o.url)) {
    2:******************************* var forms = Ext.select("form").elements;
    3:******************************* if (forms.length > 0) {
    4:*********************************** if (o.type == "submit") {
    5:*************************************** o.form = Ext.get(forms[0]);
    6:*********************************** } else {
    7:*************************************** o.url = forms[0].dom.action || Coolite.Ext.Url || window.location.href;
    8:*********************************** }
    9:******************************* }
    10:*************************** }
    It's at line 1520 of debug version of coolite-core.js of the 0.7.0 release, if that still means something.

    Line 2 sticks an array of native DOM element (not wrapped) into forms, but than in line 7, the code tries to reference as if it were an Ext.Element. Since it's not and the dom property is not defined on a form element, it throws.

    You just have to change line 7 to read:

    o.url = forms[0].action || Coolite.Ext.Url || window.location.href;
    HTH

    Alex

  6. #6

    RE: [FIXED] [V0.8.0] Bug in Coolite.AjaxEvent

    Hi Alex,

    Thanks for clarifications. It seems this code is fixed already.


    *

Similar Threads

  1. Replies: 6
    Last Post: May 26, 2009, 3:03 PM
  2. Replies: 7
    Last Post: Feb 13, 2009, 3:27 PM
  3. Replies: 4
    Last Post: Dec 04, 2008, 7:56 AM
  4. [FIXED] [V0.6] Button AjaxEvent Success
    By Timothy in forum Bugs
    Replies: 6
    Last Post: Sep 14, 2008, 10:16 AM
  5. [FIXED] [V0.6] AjaxEvent not working
    By Jurke in forum Bugs
    Replies: 3
    Last Post: Sep 09, 2008, 11:13 AM

Posting Permissions