Hi Blake, You can’t have bindings in
Validators, so the compiler is parsing required="{usePurchaseOrder.selected}"
to either true or false – and it looks like true from what you’re
saying. It’d be good if the compiler helper a bit more here, but it doesn’t. We don’t think Cairngorm store has
any bindings on validators – please let us know if it does. For what you’re wanting to do, you’re
best bet will be to drop into ActionScript and change your validators at
runtime. Cheers, Ali -- Development Director iteration::two [EMAIL PROTECTED] Office: +44 (0)131 338 6108 This e-mail and any associated attachments
transmitted with it may contain confidential information and must not be copied,
or disclosed, or used by anyone other than the intended recipient(s). If you
are not the intended recipient(s) please destroy this e-mail, and any copies of
it, immediately. Please also note that while software
systems have been used to try to ensure that this e-mail has been swept for
viruses, iteration::two do not accept responsibility for any damage or loss
caused in respect of any viruses transmitted by the e-mail. Please ensure your
own checks are carried out before any attachments are opened. From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Blake Kadatz I've been playing around with validators
and seem to have encountered a behavior which is unexpected. Here's a
sample of what I'm doing: ------------------- [snip...] <mx:Model
id="paymentInformationModel"> <mx:StringValidator
field="paymentInformationModel.purchaseordernumber"
required="{usePurchaseOrder.selected}" /> <mx:Form width="100%"> <mx:FormItem
label="Pay using purchase order" required="false">
enabled="{usePurchaseOrder.selected}"> [...snip] ---------------------- (This is modified from the Cairngorm store
and uses the Validator.isStructureValid call in the same way.) This displays correctly -- the user clicks
the checkbox to use a purchase order and the field becomes enabled and displays
an asterisk beside it. But if the user leaves it unchecked, then upon
submitting the form it still thinks the field is required. The telling
part is that if I change the StringValidator to have required="false"
instead of required="{usePurchaseOrder.selected}" then it correctly
sees it as not required. What am I missing here? Thanks, Blake
|
- RE: [flexcoders] StringValidator and required fields Alistair McLeod
- RE: [flexcoders] StringValidator and required field... Blake Kadatz
- RE: [flexcoders] StringValidator and required field... Blake Kadatz
- RE: [flexcoders] StringValidator and required field... Battershall, Jeff
- RE: [flexcoders] StringValidator and required field... Blake Kadatz