3 Replies Latest reply on Jun 8, 2010 9:11 AM by msakrejda

    How do I kill this message?

    Jerry62712 Level 1

      A very simple one for once.  I get this warning: "Data binding will not be able to detect assignments to "flatData"."  The context is:

       

      ==><mx:AdvancedDataGrid tabIndex="60"
                dataProvider="{flatData}" designViewDataType="flat"
                selectionMode="singleCell" height="90" width="100%">
                <mx:columns>
                   <mx:AdvancedDataGridColumn dataField="col1" headerText="Column 1 (mx)"/>
                   <mx:AdvancedDataGridColumn dataField="col2" headerText="Column 2 (mx)"/>
                   <mx:AdvancedDataGridColumn dataField="col3" headerText="Column 3 (mx)"/>
               </mx:columns>
            </mx:AdvancedDataGrid>

       

      And flatData looks like this:

          private var flatData:ArrayCollection = new ArrayCollection([
              {col1:"A", col2:"D", col3:"G"},
              {col1:"B", col2:"E", col3:"H"},
              {col1:"C", col2:"F", col3:"I"}
          ]);

        • 1. Re: How do I kill this message?
          BhaskerChari Level 4

          Hi,

           

          Simply put a [Bindable] metadata tag infront of ArrayCollection as shown below:

                     [Bindable]
                      private var flatData:ArrayCollection = new ArrayCollection([
                  {col1:"A", col2:"D", col3:"G"},
                  {col1:"B", col2:"E", col3:"H"},
                  {col1:"C", col2:"F", col3:"I"}
              ]);

           

          That's it It will kill the warning!!!

           

          If this post answers your question or helps, please kindly mark it as such.


          Thanks,

          Bhasker Chari

           

          • 2. Re: How do I kill this message?
            Jerry62712 Level 1

            Just to show you how dumb I am, I had tried that, but I must have misspelled the word itself.  This time I made sure I spelled (and proper-cased) it correctly and it worked.  Thanks for the quick reply.

            • 3. Re: How do I kill this message?
              msakrejda Level 4

              Another way to do this is to declare the ArrayCollection as a const instead of a var. This will have (marginally) lower overhead but, more importantly, it's more conceptually correct if you don't intend that AC to change.