Results 1 to 8 of 8

Thread: _31.elements has no properties ?

  1. #1

    Default _31.elements has no properties ?

    _31.elements has no properties
    setProgId(div#showSalesForm.x-form-ct, undefined, "javascript:false")yui-utilities.js (line 15)
    getViewWidth(div#showSalesForm.x-form-ct, "/pos/inventoryController.taf?function=itemSearch", Object scope=Object timeout=30000, undefined, undefined, "javascript:false")ext-yui-adapter.j... (line 11)
    run()

    I'm getting this when using Ext.form.submit.

    var submit = fs.addButton('Submit', function() {
    fs.submit();
    },fs);

    fs.addButton('Cancel', function() {self.close()});

    fs.render('form-ct3');

    fs.on({
    beforeaction: function(form, action){
    if (fs.isValid()) {
    var searchType = 'all';

    ds.load( {params: {start:0, limit:25, searchType: searchType, fDate: fDate.getRawValue(),tDate: tDate.getRawValue(), searchStr: searchField.getRawValue()}} );
    itemsPanel.setTitle('Results: '+ds.getCount());
    }
    },

    actioncomplete: function(form, action){
    },

    actionfailed: function(){

    }
    });

    I also have a grid that is populated with the search results.

    Any help is appreciated.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    I would suggest using ext-all-debug.js to see if you can get a better handle on what's happening. Also, via Firebug, can you see if the data is being posted to the server? Or is it not even getting that far?

  3. #3

    Default

    The data gets posted fine and this error occurs right after. I'm using firebug and ext-debug but not much information from the error to work with.

    I'm seeing this error only when submitting Ext.form data using the code shown in prev post.

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    4

    Default

    Try ext-all-debug.js, as Tim said. Ext-js.all is compacted so you get nice variable names like _3. The -debug version is human-readable so you will get a good error and be able to step through it in Firebug.

    EDIT: OK I see that you said ext-debug, so I'm not sure why you'd be getting _31.elements. Are you sure you don't also have ext-all.js in the include list?

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    4

    Default

    Ah, re-reading the error, it's coming from yui-utilities.js, so ext-all-debug will not help. You may need to replace yui-utilities.js with the corresponding uncompacted YUI files as needed to get a better idea of what's going on.

  6. #6
    Ext User
    Join Date
    Mar 2007
    Posts
    21

    Default Same Problem

    I am having the same problem this morning. From a quick look at it, it appears form that is being passed to setForm function in connection.js does not have an element's collection which the setForm function expects the form to have. I try to call form.elements after the render() on the form and the elements object is undefined. At what point is the elements collection assigned to the form object?

    Code:
    f = new Ext.form.Form({
                    labelAlign: 'top',
                   
                     // configure how to read the XML Data
                    reader : new Ext.data.XmlReader(
                        {
                            record : 'login',
                            success: '@success'
                        }, 
                        ['loginname', 'emailaddress1', 'password1']
                    ),
    
                    // reusable eror reader class defined at the end of this file
                    errorReader: new Ext.form.XmlErrorReader()
    
                });
    
                f.container ( {width: 500});
    
                f.column(
                    {width:232}, // precise column sizes or percentages or straight CSS
                    new Ext.form.TextField({
                        autoCreate: {tag: "input", type: "text", maxlength: 50},
                        fieldLabel: 'Login Name',
                        name: 'loginname',
                        id: 'loginname',
                        allowBlank:false,
                        width:200,
                        validationEvent: false
                    }),
    
                    new Ext.form.TextField({
                        autoCreate: {tag: "input", type: "text", maxlength: 255},
                        fieldLabel: 'Email Address',
                        name: 'emailaddress1',
                        id: 'emailaddress1',
                        vtype:'email',
                        allowBlank:false,
                        width:200,
                        validationEvent: false
                    }),
                    
                    new Ext.form.TextField({
                        autoCreate: {tag: "input", type: "text", maxlength: 255},
                        fieldLabel: 'Confirm Email',
                        name: 'emailaddress2',
                        id: 'emailaddress2',            
                        vtype:'email',
                        allowBlank:false,
                        width:200,
                        validationEvent: false
                    })
    
                );
    
                f.column(
                    {width:222, style:'margin-left:10px', clear:true}, // apply custom css, clear:true means it is the last column
                    new Ext.form.TextField({
                        autoCreate: {tag: "input", type: "password", maxlength: 20},
                        fieldLabel: 'Password (at least 6 characters)',
                        name: 'password1',
                        id: 'password1',
                        allowBlank:false,            
                        width:200,
                        minLength: 6,
                        validationEvent: false
                    }),
    
                    new Ext.form.TextField({
                        autoCreate: {tag: "input", type: "password", maxlength: 20},
                        fieldLabel: 'Confirm Password',
                        name: 'password2',
                        id: 'password2',
                        allowBlank:false,            
                        width:200,
                        minLength: 6,
                        validationEvent: false
                    })
                );
        
                f.end();
                f.container ( {width: 500, cls: 'agreeBlock' });
                f.column(
                    {width:400, clear:true,  labelSeparator:''}, // apply custom css, clear:true means it is the last column
                    new Ext.form.Checkbox({
                        id: 'agree',
                        labelAlign: 'left',
                        name: 'agree',
                        id: 'agree'
                    })
                );
    
                f.end();
                
                // add buttons and render the form
                sBut = f.addButton('Subscribe', this.submitForm, this);
                sBut.disabled = true;
                dBut = f.addButton('Decline', this.declineAgreement, this);
                f.render('form-ct');
    and the submit code simply has the following:

    Code:
    // validation functionality.
            submitForm : function() 
            {
                    f.submit({url:'xml-errors.xml'});
            }

  7. #7
    Ext User
    Join Date
    Mar 2007
    Posts
    21

    Default Solved my problem

    OK, I figured out what I was doing wrong. Instead of passing the form into the submit button I was passing the this object.

    Changing
    Code:
    sBut = f.addButton('Subscribe', this.submitForm, this);
    to

    Code:
    sBut = f.addButton('Subscribe', this.submitForm, f);
    solved the problem.

  8. #8

    Default

    The last error does not appear with the new 1.0.1 build but this does.

    uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: javascript: eval(__firebugTemp__); :: anonymous :: line 1" data: no]

    Any ideas...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •