-
10 May 2008 2:03 AM #41
Quick suggestion, replace:
With:Code:// install event handlers on field render field.on({ render:{single:true, scope:field, fn:function() { this.remoteValidationTask = new Ext.util.DelayedTask(this.validateRemote, this); this.el.on('keyup', this.filterRemoteValidation, this); }} });
If you don't, the remote validation will not always be triggered during the validationEvent set for your field.Code:// install event handlers on field render field.on({ render:{single:true, scope:field, fn:function() { this.remoteValidationTask = new Ext.util.DelayedTask(this.validateRemote, this); this.el.on(this.validationEvent, this.filterRemoteValidation, this); }} });
-
10 May 2008 2:46 AM #42
Yes, you're right; this way validator honors validation event set on field. Updating source.
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
11 May 2008 3:05 AM #43
I'm having more issues with the remote validation atm, regarding validation of Combo (with source from transformed select) and with validating a datefield. Will keep you updated.
-
11 May 2008 4:25 AM #44
I can't seem to enable the remote validation for a datefield or a combobox (not from a transformed, select, nor with a local store as config option).
Any suggestions?
-
11 May 2008 5:12 AM #45
Difficult to say... I validate combos and dates w/o problems...
Is the request sent to server? What comes back?Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
11 May 2008 10:52 AM #46
For some reason it's not sending a validation request to the server...
I have tried various things, just to make sure it was not an interference with any other code, I took your example form and added this item:
The server is only sending a validation request when I type in the field (as it's triggering the keyup event).Code:{ fieldLabel:'Validate combo', xtype:"combo", id:"combovalidation", name:"combovalidation", mode:"local", triggerAction:"all", forceSelection:true, enableKeyEvents:true, allowBlank:false, store: [[1, 'value 1'],[2, 'value 2'],[3, 'value 3'],['ExtJS', 'value ExtJS']], plugins : [Ext.ux.plugins.RemoteValidator], rvOptions : { url:'validate.php' } }
However when selecting a value, it's not validating.
I have tried adding:
This never triggers the validation.Code:validationEvent:'change',
And when trying this:
It triggers the validation only when clicking the triggerfield.Code:validationEvent:'select',
As i need a combobox that mimics a native select (so I disable typing, and only allow the usage of the trigger field), it won't work.
The same with the datefield, it never triggers the validation, my best guess is that it's a related problem...
-
11 May 2008 12:08 PM #47
After digging a bit deeper I found out that the remote validation is being triggered like this:
However, adding this during config of the combobox does trigger the validation:Code:this.el.on('keyup', this.filterRemoteValidation, this);
So the change I proposed yesterday is of no use, as the remote validation is being bound to this.el, instead of just this...Code:listeners: { 'select': function(combo, record, index) { combo.remoteValidationTask.delay(0); } }
-
11 May 2008 3:58 PM #48
Remote validation of combo on select does not make any sense as if some of the values in the list is invalid why it is there in the first place.
It does make sense for user typed values in combo and in that case keyup triggers remote validation.Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
11 May 2008 10:26 PM #49
It does make sense if you want to build a secure form (hence the reason I chose for remote validation). The project I'm working at requires a very high level of security, and by validating the fields remotely I keep all field requirements away from 'those eyes'.
Yes, I populate my como with values/text loaded at init, but since the source can easily be tampered with I validate ALL fields remotely, so also the combo boxes. This way I can assure the form is completely valid at submission...
-
12 May 2008 1:26 AM #50
Well, then you need to hack it somehow, to add another events that trigger validation.
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video


Reply With Quote
