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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:04:38+00:00 2026-05-12T15:04:38+00:00

<mx:DataGrid x=10 y=10 width=180 height=302 id=dgActions dataProvider={actionCollection}> <mx:columns> <mx:DataGridColumn headerText=Action dataField=name/> <mx:DataGridColumn headerText= dataField=setting

  • 0
<mx:DataGrid x="10" y="10" width="180" height="302" id="dgActions" dataProvider="{actionCollection}">
   <mx:columns>
      <mx:DataGridColumn headerText="Action" dataField="name"/>
         <mx:DataGridColumn headerText="" dataField="setting"  width="30" rendererIsEditor="true"> 
         <mx:itemRenderer >
            <mx:Component>
               <mx:Box width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                  <mx:CheckBox selected="{data.setting}" click="setActionSetting()">
                     <mx:Script>
                       <![CDATA[
                        private function setActionSetting(){
                           data.setting = String(this.selected);
                        }
                        ]]>
                     </mx:Script>
                  </mx:CheckBox>
               </mx:Box>
            </mx:Component>
         </mx:itemRenderer>
      </mx:DataGridColumn>
   </mx:columns>
</mx:DataGrid>

For some reason I’m getting an error at the data.setting= String(this.selected) line which says “Access to possibly indefined property selected through a reference with static type”.

[edit] The solution to the above problem (albeit not the entire mess) was that once you’re inside a <mx:Component> tag you are within the scope of said component. To get access to the script and nodes outside this component you have to use the outerDocument object.
[end edit]

I’m not sure what it’s expecting, I’m assuming that it’s going to pass the true/false value of the selected(ness) of the checkbox into the method, but it appears not to understand what “this” is, in this context.

Am I doing something obviously wrong? All I want is for the data source to reflect the change in the status that it initially fed into the checkbox.

EDIT:
I just noticed that when I add trace(‘foo’) to the function, it never writes anything back to the console. Is the checkbox’s native behavior (and event capture) preventing it from bubbling past to my function?

Additionally, when I add references to objects outside in the rest of the document, it tells me it doesn’t recognize them. I’m totally confused as to how Flex scopes things… any additional guidance or links to reference would be really handy.

  • 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-12T15:04:38+00:00Added an answer on May 12, 2026 at 3:04 pm

    So, after a great deal of agony I have finally figured out how this all works….

    Joel is on the right track, this doesn’t refer to what you would hope it would refer to (namely the checkbox). Additionally, even if you pass this into the method FROM the checkbox node, it refers to the parent wrapper class and not the checkbox itself. So, the solution is to pass in the event, and then access its target, which FINALLY is the checkbox. And then you’re home.

    In other words…

    <mx:CheckBox  selected="{data.setting}" click="setActionSetting(event)">
        <mx:Script>
            <![CDATA[
                private function setActionSetting(e:Event):void{
                    data.setting = e.target.selected;
                    trace("n=" + data.name + " set to " + data.setting);
                    //the name is the other piece of the data that I omitted for clarity
                }
            ]]>
        </mx:Script>
    </mx:CheckBox>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 225k
  • Answers 225k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer As noted above, commenting out the setting of AUTHENTICATION_BACKENDS made… May 13, 2026 at 1:00 am
  • Editorial Team
    Editorial Team added an answer It sounds like you're missing the correct declaration of shmat(),… May 13, 2026 at 1:00 am
  • Editorial Team
    Editorial Team added an answer Graphviz May 13, 2026 at 1:00 am

Related Questions

I've got a Flex 3 application with an HTTPService returning an Atom feed. I
I'm currently trying to map a java ArrayList with a Flex ArrayCollection, through LCDS.
I am trying my first flex application. And have a problems adding data from
<mx:DataGrid visible=false id=dgPosts width=365 click= dataProvider={sendReq.lastResult.loginsuccess.name} x=140.5 y=169> <mx:columns> <mx:DataGridColumn headerText=name dataField=name/> </mx:columns> </mx:DataGrid>

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.