Hey, was wondering if anyone else was having this issue:

The documentation for flex says "When you use argument binding, you 
provide request arguments in child tags of an <mx:RemoteObject>, 
<mx:WebService>, or <mx:HTTPService> tag. Argument binding lets you 
copy data from user interface controls or models to request 
arguments. Because request argument tags represent a data model, you 
can apply validators to argument values before submitting requests 
to data services. When you apply a validator, Flex validates the 
request just before sending it, and only sends valid requests."

This seems to be mostly true with the exception of the "only sends 
valid requests" part.  In my tests, I've found that the field 
validates, but sends the request to the RemoteObject wether the data 
is valid or not.  Here is an example of the code I am using, perhaps 
I am doing something wrong?  Does any one else have this problem?

My Code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
        <!-- my remote object-->
        <mx:RemoteObject source="classes.user" id="userObj" 
endpoint="http://localhost/flashservices/gateway"; 
showBusyCursor="true">
                <mx:method name="getUser" fault="alert
(event.fault.faultstring)" result="alert('complete');">
                        <mx:arguments>
                                <userID/>
                        </mx:arguments>
                </mx:method>
        </mx:RemoteObject>
        
        <!-- my little form -->
        <mx:Form id="myForm">
                <mx:FormHeading label="Validation Test"/>
                <mx:FormItem label="UserID" required="true">
                        <mx:TextInput id="testNumber"/>
                </mx:FormItem>
                <mx:Button label="Submit" click="userObj.getUser
();"/>
        </mx:Form>
        
        
        <!-- most of the magic that should make this work the way I 
want it to -->
        <mx:Binding source="testNumber.text" 
destination="userObj.getUser.arguments.userID"/>
        <mx:NumberValidator minValue="0" maxValue="10" 
required="True" field="userObj.getUser.arguments.userID"/>

</mx:Application>




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
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