PDA

View Full Version : how to tell if form validation monitoring is turned on?



kchiu
9 Sep 2009, 9:41 PM
Hi,

Is there a way to check if a FormPanel's validation monitoring is currently turned on or off? The 'monitorValid' config doesn't get changed/updated by those methods so I can't check using that property.

I'm currently turning validation monitoring on and off on my FormPanel via form.startMonitoring()/stopMonitoring(), and if possible, I'd like to have some form logic based on whether validation monitoring is currently turned on.

thanks a lot, cheers.

PS. firebug shows FormPanel.validTask property appears when monitoring is turned on, and disappears (ie. nullified) when monitoring is turned off. I'm tempted to use it as a flag check, though it's undocumented so depending on it might break my code if future FormPanel implementation changes.

Animal
9 Sep 2009, 10:14 PM
Add a method to FormPanel: "isMonitoring" which checks that property. Use that method in your code.

If the FormPanel implementation ever does change, then you'll only have to change that method.

kchiu
10 Sep 2009, 5:53 AM
Good idea, thanks.

Does this mean there's no official/standard way of doing the check though? (at least for the time being?)

cheers.