PDA

View Full Version : Set value of a textfield from localstorage



damandeep.singh
31 Oct 2012, 10:17 PM
Hi Guys,

I need a small help in setting the value of a textfield from my localstorage.

I am using Ext.getCmp('text-field-id').setValue(newValue);

I am getting error as :


Uncaught TypeError: Cannot call method 'setValue' of undefined

But I am able to get my value from localstorage if I am checking the same in my console as
console.log(newValue);

Please Help.


Thanks
Damandeep

danguba
1 Nov 2012, 12:01 AM
Are you sure you have ExtJS text field with id "text-field-id"? Error you are receiving means that there is no ExtJS component with that id thus Ext.getCmp('text-field-id') is undefined

damandeep.singh
1 Nov 2012, 2:05 AM
Hi,

The problem has been resolved.

Thanks,
Daman

danguba
1 Nov 2012, 2:26 AM
I'm glad you fixed it