In this and the other questions you've asked recently you're trying to bind
and validate with elements in an array (the 0th element).  Binding and
validation really aren't set up to work with arrays like this.  What I would
do is consider creating a separate model, copying the data from vpof[0] to
that model, and then doing all of your validation with it.  That way you can
take the array out of the equation and work with normal binding and
validation.

Matt

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 18, 2005 9:05 AM
To: Flex Coders
Subject: [flexcoders] Validator don't work


Hi, i have try to implement my solution but don't work


mx:Validator field="PfVO(vopf[0]).pfvopk.stagpf" 
validate="checkRequired(event.validator, event.value,10)" 
listener="lstag" />
<mx:Validator field="PfVO(vopf[0]).de50pf" 
validate="checkRequired(event.validator, event.value,50)" 
listener="lmodello" />


 
   function checkRequired(validator: Validator, value: String,pos) : Void {
      
       if(value==undefined)
         validator.validationError("emptyValue", "Campo obbligatorio!");
       else if( String( value ).length>pos)   
          validator.validationError("emptyValue", "lunghezza max 
consentita "+pos+"!"); 
      
       
   }



Can you help me
Devis


 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to