Title: New to Flex and having difficulties with validation

You want each individual field validated the same way or are you trying to validate the edgesmodel as a whole? Validators don’t really work well with repeated elements.  You can use someof the static utility methods to set something up, but then having it turn the borders of the textinputs red gets more difficult.

 

Matt

 


From: Jeroen De Vos [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 03, 2005 6:59 AM
To: [email protected]
Subject: [flexcoders] New toFlex and having difficulties with validation

 

Hello everyone,

I'm new to Flex (started on Monday) and I'm having a lot of difficulties with validation.
Here's the situation:
I have a model in which I load data from an external XML
<mx:Model id="edgesmodel" source="edges.xml"/>

Then I use a repeater to put the information on screen:
<mx:Form>
        <mx:Repeater id="edgesrepeater" dataProvider="{edgesmodel.edge}" recycleChildren="true">                             

                <mx:FormItem label="{edgesrepeater.currentItem.label} : " required="true">
                        <mx:TextInput id="edgeinput" width="75" text="{edgesrepeater.currentItem.value}" />
                      </mx:FormItem>                           
        </mx:Repeater>
</mx:Form>

The user can change the edge value in the textinput field, so I wrote a function which updates the information in the model (this works fine).

And finally I would like to do validation on the value field of the edgesmodel before I execute the program.
Could someone point out how I can do this validation?

Thanks a lot!
Jeroen.

 

________________________________

Jeroen De Vos
Gemeentelijk Havenbedrijf Antwerpen
C/ICT - AMARIS
________________________________



Reply via email to