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 9003435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:42:42+00:00 2026-06-16T00:42:42+00:00

Say, I have a datagrid with checkboxes, and each time a checkbox is marked

  • 0

Say, I have a datagrid with checkboxes, and each time a checkbox is marked I store the object in the data property of flex ResultEvent

public class MyItemRenderer extends ItemRenderer{

   public static var CLICK:String = "CheckBoxClick";      

   protected function itemRendererClickListener(data:Object):void{

    dispatchEvent(new ResultEvent(MyItemRenderer.CLICK, data))
    }

}

I handle the result here.

protected function checkbox_clicked(event:ResultEvent):void{
    //Here I do everything I want with the data.
    Alert.show(event.result.toString());
}

This is what I’ve been using for months, but I never wondererd if this was a bad practice.

Or let alone bad practice, what is the optimal way to do this?

  • 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-06-16T00:42:43+00:00Added an answer on June 16, 2026 at 12:42 am

    it’s not really ‘bad’. But it does create an additional reference to an object that can potentially keep that object in memory longer (or indefinitely if not managed well).

    Generally speaking, you should only store data related to the event itself in the event instance. You can use the event.target and event.currentTarget properties to reference back to the object that dispatched the event and get data that way.

    In your case, your event is a check box state change. The event itself (being checked) doesn’t need any data associated with it besides the item being checked (which you can get with ‘target’ or ‘currentTarget’). So it would be more appropriate in my opinion to do the following:

    Alert.show(MyItemRenderer(event.currentTarget).data.toString());
    

    This keeps your events more reusable

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

Sidebar

Related Questions

Say I have a DataGrid with its ItemsSource binding to a data table(whose columns
Lets say I have a custom data type that looks something like this: public
Let's say I have data structures that're something like this: Public Class AttendenceRecord Public
I have a datagrid in my mxml file, say, samp.mxml. <mx:DataGrid id=taskDataGrid dataProvider={initDG} variableRowHeight=true
Lets say I have 2 columns in my data Grid: Column A: Selected, and
Lets say have this immutable record type: public class Record { public Record(int x,
Say I have a select box eg <div data-bind='visible: someProp'> <select class=selectSubWidgets data-bind='options: subWidgets,optionsText:
I have a datagrid say Grid1 and I have a datatable called Dt in
Say I have a datagridview filled with rows. Now to make certain data more
Lets say I have the following values that I'm loading into a datagrid ID

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.