Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6140649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:08:46+00:00 2026-05-23T18:08:46+00:00

Let me try to explain this the best I can. I have a component

  • 0

Let me try to explain this the best I can.

I have a component containing a data grid with the following data grid column

        <mx:DataGridColumn dataField="email" headerText="Email Address">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:VBox width="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" horizontalAlign="center">
                        <mx:TextInput id="tiEmailAddress" 
                                                width="95%"
                                                text="{data.email}"
                                                invalid="{data.isNotValidEmail(event);}"
                                                valid="{data.isValidEmail(event);}"/>
                        <mx:EmailValidator id="validatorEmailAddress"
                                      source="{tiEmailAddress}"
                                      property="text"
                                      required="true"
                                      requiredFieldError="Email address is required."/>
                    </mx:VBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>

Here’s the guts of my value object:

[Bindable(event="contactChange")]
public class ContactVO extends EventDispatcher
{
    private var _email:String = "default email";

    public var selected:Boolean = false;
    public var edited:Boolean = false;
    public var isNew:Boolean = false;
    public var isValid:Boolean = false;


    public function ContactVO()
    {       }


    public function isNotValidEmail(e:Event):void
    {
        isValid = false;
        email = e.target.text;          
    }


    public function isValidEmail(e:Event):void
    {
        isValid = true;
        email = e.target.text;
    }


    public function get email():String   
    {                       
        return _email;
    }             


    public function set email(value:String) : void 
    {                       
        if (value != _email) {
            _email = value;
            edited = true;
        }
        dispatchEvent(new Event("contactChange", true));
    }

}

Then back in the component, I have this which gets called at creationComplete

addEventListener("contactChange", processContactChange);

Through the Flex debugger, I can see the addEventListener statement called when the component is created, I can see the event fired from the value object when the validation is performed and the value changes, but processContactChange is never called, so I assume the event is never making it to my component.

Any idea what I’ve gotten wrong here? Thanks!

[SOLUTION]

The conversation with @Flextras below helped to deepen my understanding of this process and figure out where the disconnect was in my understanding. Basically, I changed the innards of my component’s data column entry to the following:

                        <mx:TextInput id="tiEmailAddress" 
                                                width="95%"
                                                text="{data.email}"
                                                invalid="{data.isNotValidEmail(event);}"
                                                valid="{data.isValidEmail(event);}"
                                                creationComplete="{addListener(data)}"/>
                        <mx:Script>
                            <![CDATA[
                                private function addListener(data:Object):void
                                {
                                    var eventDispatcher:EventDispatcher = data as EventDispatcher;
                                    eventDispatcher.addEventListener("contactChange", outerDocument.processContactChange);
                                }
                            ]]>
                        </mx:Script>

and removed the event listener from my creationComplete method

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:08:47+00:00Added an answer on May 23, 2026 at 6:08 pm

    When you add the event listener you have to add it to the class that fires the event. In your code, you’re adding it to the component that contains the DataGrid. Neither the itemRenderer, DataGrid, nor component containing the DataGrid fire the event.

    IF the component containing the DataGrid has access to the ContactVO event, you can listen directly on that.

    Otherwise, you can add an event listener in your itemRenderer.

    If you absolutely need to execute code in the component containing the DataGrid, then the itemRenderer should listen on the Value Object for the event, then fire an event of it’s own. Make sure that the ‘itemRenderer’ event bubbles; and it will move up the display hierarchy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me try to explain this to the best of my ability: I have
Let me try to explain the situation the best I can. Lets say I
Ok, let me try and explain this to the best of my ability. Lets
Let me try to explain this, I have a string like this: b.c And
Let me try to explain... Lets say I have the following 'a' tags on
Let me try to explain what I need. I have a server that is
This title may seem strange, so let me try to explain what I'm trying
Let me try to explain what the situation is as thoroughly as I can
Let me try and explain this. Within a project folder has .m and .h
Let me try to explain it. Please tell me if I am wrong. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.