-
12 Dec 2007 6:40 AM #1
Problem with Ext.form.TextField's validationEvent config option
Problem with Ext.form.TextField's validationEvent config option
Hi
I am creating a TextField using below code:
{fieldLabel:'Project Code', name: 'caseId', allowBlank: false, msgTarget: 'side', validator: validateProjectId, validationEvent: blur},
This causes my IE (6.0.2900.2180) to crash.
When i change the validationEvent to onblur, it works in IE but there is a JS error in mozilla.
I think the second behaviour is correct as the TextField do have a blur event.
But can anyone tell the reason for IE's absurd behaviour.
Thanks
-
12 Dec 2007 6:47 AM #2
set validationEvent: false, unless you really need it.
Make everything as simple as possible, but not simpler.
- Albert Einstein
-
13 Dec 2007 6:39 AM #3
Thanks Santosh
Correction first, in my original post i was actually referring to the first implementation and not the 'second behaviour'.
Yes i can set validationEvent to false but i want to initiate validations on blur event.
I think there will be no blur event if i set validationEvent to false.
Is there any other way to do this.
Thanks
-
13 Dec 2007 6:44 AM #4
validationEvent should be a string.
validationEvent: 'blur'Aaron Conran
@aconran
Sencha Architect Development Team
-
13 Dec 2007 10:02 AM #5
@aconran
I agree with you and i did set validationEvent: 'blur'
But with IE(6.0.2900.2180) whenever i open the window i get a message 'IE has encountered a problem and needs to close'. When i change the event to onblur(not a correct event name) it works perfectly fine in my version of IE.
I also tested this on IE(7.0.5700.6) and got JS error saying 'this.el' is null or not an object at line 88 and char 2579.
The code i am using for TextField is -
{fieldLabel:'Project Code', name: 'caseId', allowBlank: false, msgTarget: 'side', validator: validateProjectId, validationEvent: blur}
Currently i am using a workaround which works on both IE(above versions) and Mozilla(2.0.0.11) -
{fieldLabel:'Project Code', name: 'caseId', allowBlank: false, msgTarget: 'side', listeners: {'blur': validateProjectId}}
Please let me know your views
Thanks
-
13 Dec 2007 10:40 AM #6
I suppose we could continue to guess without seeing more than a single config entry....
Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
14 Dec 2007 3:29 AM #7
@tryanDLS
I am posting the code i am using, modified for readability.
I have a window with a formpanel which inturn contains a tabpanel for three different tabs. The error is coming at the line marked red :
Please let me know if more information is required.Code:win = desktop.createWindow({ id: 'add-win', title: 'Add New Project', x: 10, y: 10, width: 740, height: 300, iconCls: 'addNewProject', border: false, autoScroll: true, maximized: true, items: new Ext.FormPanel({ id: 'add-form', labelWidth: 400, border: false, frame: true, hideBorders: true, items: { xtype: 'tabpanel', tabPosition: 'top', border: true, activeTab: 0, defaults: {autoHeight: true, autoScroll: true, autoWidth: true}, items: [{ title: 'General', layout: 'form', frame: true, defaults: {autoHeight: true, autoScroll: true, autoWidth: true}, items: [{ xtype: 'fieldset', title: 'General Details', defaults: {width: 200, labelSeparator: ''}, defaultType: 'textfield', items: [ {fieldLabel:'Project Code', name: 'caseId', allowBlank: false, msgTarget: 'side', validator: validateProjectId, validationEvent: blur}, {fieldLabel:'Project Name', name: 'caseName', allowBlank: false, msgTarget: 'side'}, ... ] }] }, { ...2nd Tab },{ ...3rd Tab }] }, buttons: [{ text: 'Save', handler: projectSubmit, iconCls: 'save', tooltip: 'Add/Save the new Project', scope: this }, ...] }) });
Thanks
-
19 Dec 2007 6:57 AM #8
@All
Please let me know your views regarding config option validationEvent:'blur' problem i am facing.
Sorry for being impatient.


Reply With Quote