[CLOSED] Runtime client error in /extnet/extnet-core-js/ext.axd?v=0

  1. #1

    [CLOSED] Runtime client error in /extnet/extnet-core-js/ext.axd?v=0

    Hi,

    After a routine application publishing to QA, we're suddenly getting a runtime javascript error, whose definition reads differently for IE8 and IE9.

    IE8:
    'this.store.getAt{...}' is null or not an object          Line: 465
    ext.axd                                                              Char: 459
    Code: 0
    URI: http://myhost/myapp/extnet/extnet-core-js/ext.axd?v=0
    IE9:
    Unable to get value of the property 'get': object is null or undefined          Line: 465
    ext.axd                                                                                                Char: 459
    Code: 0
    URI: http://myhost/myapp/extnet/extnet-core-js/ext.axd?v=0
    I'm puzzled - it works perfectly well when published to DEV environment or locally with the same setup. Data is nearly identical in both environments, IIS and ASP.NET are setup the same way, all the assemblies are copied correctly, in my opinion. And it worked in QA before.
    I'm guessing it has to do with selecting an item in the databound combo, but again, it was just fine.

    Please advise if you have any insight into this error causes or if you need more details.
    Last edited by Daniil; Aug 24, 2012 at 1:17 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please provide more details.

    Does the error occur initially or after some user actions?

    Do you set up SelectedItem for this ComboBox? If yes, please try to remove and check the error is still reproducible or not.

    How do you populate the ComboBox Store?

    Are you able to provide an online link to reproduce the problem?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Please provide more details.

    Does the error occur initially or after some user actions?

    Do you set up SelectedItem for this ComboBox? If yes, please try to remove and check the error is still reproducible or not.

    How do you populate the ComboBox Store?

    Are you able to provide an online link to reproduce the problem?
    Hi,

    The DocumentReady handler completes successfully. I commented out all calls to
    combo.SelectedItem.Value=someValue;
    ComboBox stores are populated on the server like this:

                if (!X.IsAjaxRequest)
                {
                    typedDataTable= GetData();
                    this.Store1.DataSource = typedDataTable;
                    this.Store1.DataBind();
                }
    The error still persists. It's an Intranet application, it would be difficult to provide an online link to it.
  4. #4
    Hi Daniil,

    Sorry for the hassle. The problem was on our side. After re-pointing the connection string for WCF services to DEV, it disappeared, which gave me a clear indication that the data store structure or data itself was to blame.

    Going forward, it would be nice to learn from this experience to distinguish data related exceptions thrown by Ext.Net framework. Maybe, some specific error handlers could help. Thanks for bearing with me on this, you can mark this thread as resolved.
  5. #5
    Quote Originally Posted by vadym.f View Post
    Going forward, it would be nice to learn from this experience to distinguish data related exceptions thrown by Ext.Net framework. Maybe, some specific error handlers could help.
    I don't know what we could do for this case.

    If you will be able to provide us with a sample to reproduce the issue, we would investigate a possibility to prevent the error and show some friendly message.

    Maybe, are you able to suggest some concrete things that we can improve? We would happy to investigate.
    Last edited by Daniil; Aug 24, 2012 at 1:44 PM.
  6. #6
    Quote Originally Posted by Daniil View Post
    I don't know what we could do for this case.

    If you will be able to provide us with a sample to reproduce the issue, we would investigate a possibility to prevent the error and show some friendly message.

    Maybe, are you able to suggest some concrete things that we can improve? We would happy to investigate.
    One of the data retrieval stored procedures was outdated receiving more parameters than expected. That SQL error never seemed to make it through the tiers to the web client so the ultimate result was probably an empty store on the client. Since I populate the store on the server not having any client side code to break in that instance, the exception got thrown in the Ext.Net framework. At least, that's my understanding of the situation.
  7. #7
    Hi Daniil,

    I was able to reproduce my original problem. Please refer to the code snippet below. If the Store remains empty but the ComboBox has SelectedIndex set, a client side error is thrown by the Ext.Net framework. DisplayField and ValueField appear inconsequential in this instance. It's up to you how you decide to call it, but it would be nice if something can be done to provide a meaningful message or other initial error handling as you see fit. Hope this was helpful.

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                // The Store is not loaded here, which causes a JS error thrown by the framework
                // if the ComboBox has SelectedIndex property set
            }
        }
    </script>
    <!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="Head1" runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Store runat="server" ID="StoreCombo1">
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="Id" />
                        <ext:RecordField Name="Desc" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:ComboBox runat="server" ID="ComboBox1" StoreID="StoreCombo1"
            FieldLabel="Description" DisplayField="Desc"
            ValueField="Id" SelectedIndex="0">
        </ext:ComboBox>
        </form>
    </body>
    </html>
  8. #8
    Thanks for the sample. I think it is just a bug. We should check a record with the specified index is available in the Store.

    Please use the following fix or update from SVN (revision #4292). Also the fix will be included in v1.6.

    Fix
    <ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />
    
    <script type="text/javascript">
        Ext.form.ComboBox.override({
            selectByIndex : function (index, fireSelect) {
                var r;
    
                if (index >= 0) {
                    r = this.store.getAt(index);
                    if (r) {
                        this[this.fireSelect ? "setValueAndFireSelect" : "setValue"](r.get(this.valueField || this.displayField));
                    }
                }
            }
        });
    </script>

Similar Threads

  1. [CLOSED] Coolite 0.8.2 and ExtNet 2.0 in the same project?
    By Pablo in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 13, 2012, 6:54 PM
  2. Show ExtNet.Msg.Alert on Command Event ?
    By Mohammad in forum 1.x Help
    Replies: 2
    Last Post: Oct 25, 2011, 5:55 AM
  3. updating to ExtNet 1.0 from 0.8.2
    By unaltro2 in forum 1.x Help
    Replies: 6
    Last Post: Jun 03, 2011, 5:14 PM
  4. [CLOSED] Errors in extnet css
    By acrossdev in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 07, 2010, 9:00 AM
  5. [CLOSED] [1.0] extnet-core-debug.js
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 11, 2010, 2:08 PM

Posting Permissions