2 Replies Latest reply on Mar 13, 2008 2:12 PM by SiHoop


    SiHoop Level 1
      I'm trying to control the value of a checkbox with information that I'm pulling from a database.
      <mx:CheckBox label="Checkbox" width="100" id="specialNeedsCheckbox0" selected="{studentsDataGrid.selectedItem.disability}" enabled="true" />

      The code is not working, so I'm trying to find the value stored in studentsDataGrid.selectedItem.disability to see if it's a 1 or 0.

      studentsDataGrid is a datagrid tied to a dataProvider: dataProvider="{studentsColumn}"
      studentsColumn is an ArrayCollection.
      My question: How can I access the variables stored in the ArrayCollection to allow me to look directly at their content?
        • 1. Re: ArrayCollection
          SiHoop Level 1
          As a follow-up to my earlier question: How can I convert a variable from an integer to a boolean when it is imported into Flex? I've figured out that the simple way to view the data is to add a column to the datagrid. However, my checkbox can only be controlled with a Boolean value, but I don't know how to convert my variable stored in the datagrid into a boolean. I've tried hard coding the variable with 1/0 and true/ false, but it fails when I use a reference to its dataProvider. This leads me to suspect that the imported data is a String and that the value stored in the string needs to be converted if it is to be usable.
          • 2. Re: ArrayCollection
            SiHoop Level 1
            I found a solution to my problem, although it does so outside Flex. My solution was to modify the variable in php using a simple loop to convert the text value that was being generated by php into a Boolean value. That completely solved the problem inside Flex.