1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    149
    Answers
    2
    Vote Rating
    1
    sachintaware is on a distinguished road

      0  

    Default Answered: Uncaught TypeError: Cannot call method 'setValue' of undefined

    Answered: Uncaught TypeError: Cannot call method 'setValue' of undefined


    Hello
    I have an email app,which uses extjs4 and springmvc.Now on the first attempt everything works fine.
    i.e user can log in send mail,but after once the email is sent,if the user clicks on the send email button again,I get the following error in firebug.
    Code:
     Uncaught TypeError: Cannot call method 'setValue' of undefined
    at this line.
    Code:
    Ext.getCmp('send-to').setValue(emailAddress);
    I have used the ext.onready method for invoking the app.Also,I have the ext-all.js.Then why is the error occuring.
    Here is the entire js code for the error.
    Code:
     var emailbtn =  new Ext.Button({
                         text    :'Send Email',
                         scale   :'medium',  
                         enableToggle:true, 
                         renderTo:'buttonMail',
                         handler : function(){      
                                                         
                                    var emailAddress  = new Array();
                                    var candidateName = new Array();
                                    for(var i=0; i< store_company.getCount(); i++)
                                           {
                                                emailAddress.push(store_company.getAt(i).get('email'));
                                                candidateName.push(store_company.getAt(i).get('firstName'));
                                                
                                               // console.log(emailAddress);
                                               // console.log(candidateName);
                                                
                                                Ext.getCmp('send-to').setValue(emailAddress);
                                                Ext.getCmp('fName').setValue(candidateName);
                                                Ext.getCmp('send-email-window').show();
                                            }
                                        }
                       
                        });
    send-to is the id of the field declared in the form.

    What can I do to resolve the issue??

    Thanks

  2. http://docs.sencha.com/ext-js/4-1/#!/api/Ext.window.Window-cfg-closeAction
    By default window destroys after close, set values after window show:
    PHP Code:
    Ext.getCmp('send-email-window').show(null, function () {
      
    Ext.getCmp('send-to').setValue(emailAddress);
      
    Ext.getCmp('fName').setValue(candidateName);
    }); 
    or
    PHP Code:
    var win Ext.getCmp('send-email-window');
    win.on('render', function () {
      
    Ext.getCmp('send-to').setValue(emailAddress);
      
    Ext.getCmp('fName').setValue(candidateName);
    }, 
    this, {singletrue});
    win.show(); 

  3. #2
    Sencha User
    Join Date
    May 2011
    Location
    Ukraine, Rivne
    Posts
    247
    Answers
    44
    Vote Rating
    41
    redraid has a spectacular aura about redraid has a spectacular aura about redraid has a spectacular aura about

      0  

    Default


    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.window.Window-cfg-closeAction
    By default window destroys after close, set values after window show:
    PHP Code:
    Ext.getCmp('send-email-window').show(null, function () {
      
    Ext.getCmp('send-to').setValue(emailAddress);
      
    Ext.getCmp('fName').setValue(candidateName);
    }); 
    or
    PHP Code:
    var win Ext.getCmp('send-email-window');
    win.on('render', function () {
      
    Ext.getCmp('send-to').setValue(emailAddress);
      
    Ext.getCmp('fName').setValue(candidateName);
    }, 
    this, {singletrue});
    win.show(); 

  4. #3
    Sencha User
    Join Date
    May 2011
    Location
    Ukraine, Rivne
    Posts
    247
    Answers
    44
    Vote Rating
    41
    redraid has a spectacular aura about redraid has a spectacular aura about redraid has a spectacular aura about

      0  

    Default


    Using global ID bad - use itemId -
    PHP Code:
    // window items
    items: [
      ...
      {
    itemId'myField', ....}
      ...
    ]

    // Query item
    myField win.down('#myField'); 

  5. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    149
    Answers
    2
    Vote Rating
    1
    sachintaware is on a distinguished road

      0  

    Default


    Thank you redraid
    I should have thought about that.
    Can you just help me once again.I have a thread opened here regarding browser redirection issue.

    http://www.sencha.com/forum/showthre...for-Login-Page

    Please have a look and give your comments.I am able to login first attempt,but after logging out,I am not able to log in again.

    Thanks

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar