Here is my field definition:

<mx:FormItem label="email">
                                                        <mx:TextInput 
id="email" textInput="
                                                                
salesreps.selectedItem.changed=(salesreps.selectedItem.changed==0 ? 
                                                                1 : 
salesreps.selectedItem.changed)"
                                                                
valueCommit="c.formatEmails(email, salesreps)"                                  
                         
                                                                
text="{XML(salesreps.selectedItem).email}"/>           
                                                </mx:FormItem>
What I am trying to do is to set a flag if data has been changed and also 
format an e-mail when a user is leaving the field. 

public function formatEmails(Name:Object, bindObj:Object=null):Boolean 
                {        
                        if (validations(Name, "email") && bindObj != null)
                {
                        Name.text = toTitleCase(Name.text);
                        bindObj.dataProvider[bindObj.selectedIndex][Name.id] = 
Name.text;
                        return true;
            }  
            else
            {
                return false;
            }   
        }
This code works, at most part. If I leave the field to anywhere but DataGrid 
(salesreps) then salesreps gets its email column updated correctly, but if I 
leave the email field b clicking on a row in the DataGrid then the clicked row 
gets the email value. It's my problem is clear is there a solution?

Thanks


Reply via email to