I've got a component that extends TextInput that I need to do some
extra stuff for validation with, so I've done the following:

                override public function
validationResultHandler(event:ValidationResultEvent):void
                {
                        super.validationResultHandler(event);
                        if(event.results[0]["isError"])
                        {
                                invalidHandler();
                        }
                        else
                        {
                                validHandler();
                        }
                }

which works fine as long as every component has a validator assigned
to it. When I just had seperate functions tied to the event (i.e.
addEventListener('valid', validHandler);) I wasn't getting the little
red errorTip showing up, so I went with this which seems to work ok.
However, as soon as I have a component that doesn't have a
validator assigned I get the following:


Cannot access a property or method of a null object reference.
        at controls::SmartTextInput/validationResultHandler()
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.validators::Validator/::processValidation()
        at mx.validators::Validator/validate()

I could have two versions of my component, one validating and one not,
but that seems silly. Anyone know what's going on? I looked through
the UIComponent.as and ValidationResultEvent.as without seeing
anything that made much sense.






--
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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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