Just one technique: using AS, throw the validators into an ArrayCollection on
creationComplete. Before you submit, loop through the validators and execute
the validate() function on each. If one fails, bail out. The docs can show
you how to work with ValidationResultEvent. Also remember
first you trying to use numChildren as a method but it is not it is a
property which return int value and it is read-only so remove the () in the loop
second what is errorString ???
import mx.core.UIComponent;
private function formIsValid():Boolean
{
var validForm:Boolean = true;
for (var i:int = 0; i this.numChildren; i++)
{
if ( UIComponent(this.getChildAt(i)).errorString != )
{
validForm = false;
}
At 04:24 PM 5/18/2009, you wrote:
first you trying to use numChildren as a method but it is not it is a
property which return int value and it is read-only so remove the ()
in the loop
second what is errorString ???
Oh LOL -- now I feel like an idiot. Of course, it's a property not
a
At 04:54 PM 5/18/2009, you wrote:
import mx.core.UIComponent;
private function formIsValid():Boolean
{
var validForm:Boolean = true;
for (var i:int = 0; i this.numChildren; i++)
{
if ( UIComponent(this.getChildAt(i)).errorString != )
{
Why not stop and return when validForm just turns false, like this:
On Mon, May 18, 2009 at 5:54 PM, Tim Hoff timh...@aol.com wrote:
*
import
* mx.core.UIComponent;
*private* *function* formIsValid():Boolean
{
* for* (*var* i:int = 0; i *this*.numChildren; i++)
{
*
Yep, good re-factor.
-TH
--- In flexcoders@yahoogroups.com, Ivan Perez manope...@... wrote:
Why not stop and return when validForm just turns false, like this:
On Mon, May 18, 2009 at 5:54 PM, Tim Hoff timh...@... wrote:
*
import
* mx.core.UIComponent;
*private* *function*
At 05:13 PM 5/18/2009, you wrote:
Why not stop and return when validForm just turns false, like this:
On Mon, May 18, 2009 at 5:54 PM, Tim Hoff
mailto:timh...@aol.comtimh...@aol.com wrote:
import
mx.core.UIComponent;
private function formIsValid():Boolean
{
for (var i:int = 0; i
Are you sure that you are looking for the children in the correct
parent? Worked for me.
-TH
--- In flexcoders@yahoogroups.com, Laurence MacNeill lmacne...@...
wrote:
At 05:13 PM 5/18/2009, you wrote:
Why not stop and return when validForm just turns false, like this:
On Mon, May 18,
At 07:56 PM 5/18/2009, you wrote:
Are you sure that you are looking for the children in the correct
parent? Worked for me.
-TH
Ahh -- that's probably it. All the textInputs I'm looking for are in
a Form. Which makes them children of the Form? Or children of each
FormItem tag? How would
Almost seems like you'd want to loop through the validators instead,
huh?
-TH
--- In flexcoders@yahoogroups.com, Laurence MacNeill lmacne...@...
wrote:
At 07:56 PM 5/18/2009, you wrote:
Are you sure that you are looking for the children in the correct
parent? Worked for me.
-TH
Ahh
At 08:13 PM 5/18/2009, you wrote:
Almost seems like you'd want to loop through the validators instead,
huh?
-TH
Didn't know I could do that... How would I go about doing that?
Thanks,
Laurence MacNeill
Mableton, Georgia, USA
12 matches
Mail list logo