[CLOSED] Can't execute code from a freed script error only in IE

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Can't execute code from a freed script error only in IE

    This is the context:
    Ext.onReady(function () { _frmMain = <%=frmMain.ClientID%>; 
            _certAndScreenPanel = <%=pnlCertAndScreen.ClientId %>;
            itemId = <%=inc.initInt(Request("itemId"))%>; 
            orgType = <%= orgType %>
            fillForm();bindCombo();});
    
    
     function fillForm(record) {
                if (!itemId) return;
                if (!record) {
                    record = top._vmsTabPanel.GetWndTab().stoCertAndScreen.getById(itemId);
                }
                setFormDisplay(record);
             
                _frmMain.form.items.each(function (i) { if (i.dataIndex) i.setValue(record.data[i.dataIndex]); } )
                //_frmMain.form.loadRecord(record);
                if (!cmbCertAndScreenList.adjW) {
                    newWidth = cmbCertAndScreenList.getWidth();
                    cmbCertAndScreenList.growMin = newWidth - 17;
                }
            }

    Breaks on this when trying to setValue for a datefield:
    _frmMain.form.items.each(function (i) { if (i.dataIndex) i.setValue(record.data[i.dataIndex]); } )

    This is where error occurs:

    formatDate : function(date){
            return Ext.isDate(date) ? date.dateFormat(this.format) : date;
        },

    Any idea?

    Thanks
    Last edited by Daniil; Nov 02, 2011 at 4:11 PM. Reason: [CLOSED]
  2. #2
    Please reopen! The second comment was made by mistake.

    The issue I am talking about still exists!
  3. #3
    Hi,

    Is the "record" not null?
    record = top._vmsTabPanel.GetWndTab().stoCertAndScreen.getById(itemId);
  4. #4
    Quote Originally Posted by Daniil View Post
    Hi,

    Is the "record" not null?
    record = top._vmsTabPanel.GetWndTab().stoCertAndScreen.getById(itemId);

    Yes the record is not null! Like I said in FF it works just fine.
    There is an issue with date fields only, if I exclude them it works OK.
    It seems their value is not correct, have doubts that they neglect their 'date' nature and try to push string value into datefield on the form.
    anyway on datefield.setValue(... it breaks in the line above (format)
  5. #5
    Can you provide RecordField definitions? Did you mark that field as Date (Type="Date")?
  6. #6
    Quote Originally Posted by Vladimir View Post
    Can you provide RecordField definitions? Did you mark that field as Date (Type="Date")?
    Vladimir, the 'Date' is in markup's store definiton,
    anyway the new record was created in js based on store definition (one line of code in js) guess you know what is it about, don't have the code in front me now.


    Thank you.
  7. #7
    Here is a similar issue:
    http://forums.ext.net/showthread.php?13409

    Please clarify how and where do you create a record?
  8. #8
    Quote Originally Posted by Daniil View Post
    Here is a similar issue:
    http://forums.ext.net/showthread.php?13409

    Please clarify how and where do you create a record?
    The existing store (as you can see both dates are of type = 'Date'):
     <ext:Store ID="stoCertAndScreen" runat="server" ClientIDMode="Static">
                <Reader>
                    <ext:JsonReader IDProperty="ReqCertID">
                        <Fields>
                            <ext:RecordField Name="ReqCertDetailID" />
                            <ext:RecordField Name="ReqCertID" />
                            <ext:RecordField Name="ReqCrtDetailResponseID" />
                            <ext:RecordField Name="DescriptionText" />
                            <ext:RecordField Name="SequentialNumber" />
                            <ext:RecordField Name="LocationFg" />
                            <ext:RecordField Name="AchievedDateFg" />
                            <ext:RecordField Name="ExpireDateFg" />
                            <ext:RecordField Name="CertificationTextFg" />
                            <ext:RecordField Name="ResponseFg" />
                            <ext:RecordField Name="CommentFg" />
                            <ext:RecordField Name="DisplayVendorFg" />
                            <ext:RecordField Name="RequiredBeforeEngtFg" />
                            <ext:RecordField Name="CreatedOnEngtFg" />
                            <ext:RecordField Name="LocationText" />
                            <ext:RecordField Name="AchievedDate" Type="Date" AllowBlank="true" />
                            <ext:RecordField Name="ExpireDate" Type="Date" AllowBlank="true" />
                            <ext:RecordField Name="CertificationText" />
                            <ext:RecordField Name="MeetCrtFg">
                                <Convert Handler=" return value == null?'NA':value; " />
                            </ext:RecordField>
                            <ext:RecordField Name="CommentText" />
                            <ext:RecordField Name="OrgTypeCd" />
                            <ext:RecordField Name="CandID" />
                            <ext:RecordField Name="itemValid" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
                <Listeners>
                    <Update Handler="validateScreenAndCerts();" />
                </Listeners>
            </ext:Store>
    Create record:
     function createRecord() {
    
            var recDefinition = new Ext.data.Record.create(stoCertAndScreen.reader.meta.fields);
            var record = new recDefinition();
            return record;
    
        }

    The thing here is that this record was created and populated from the popup (anoter frame that does not exist anymore), now it is recreated. This is how it was created first time:

    function addCertItem() {
                var store = top._vmsTabPanel.GetWndTab().stoCertAndScreen;
                //var recDefinition = new top.Ext.data.Record.create(store.reader.meta.fields);
                var record = top._vmsTabPanel.GetWndTab().createRecord();
  9. #9
    Please try to add "parent" or "top" here before "Ext":
    var recDefinition = new parent.Ext.data.Record.create(stoCertAndScreen.reader.meta.fields);
  10. #10
    Quote Originally Posted by Daniil View Post
    Please try to add "parent" or "top" here before "Ext":
    var recDefinition = new parent.Ext.data.Record.create(stoCertAndScreen.reader.meta.fields);
    Unfortunately, it does not help.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 17
    Last Post: Oct 12, 2011, 4:54 PM
  2. Replies: 4
    Last Post: Jan 25, 2011, 10:39 AM
  3. Messagebox confirmation and code to execute
    By unaltro2 in forum 1.x Help
    Replies: 2
    Last Post: Jan 08, 2010, 6:20 AM
  4. Replies: 4
    Last Post: Oct 20, 2009, 6:43 PM
  5. Replies: 2
    Last Post: Jul 29, 2009, 1:57 PM

Tags for this Thread

Posting Permissions