Definitely is a bug.  I’ll go ahead and file it.  I don’t have a workaround for you right now, maybe try re-creating the ArrayCollection instead of just the inner array?  myAC = new ArrayCollection(projectFiles) instead of re-assigning projectFiles.  I don’t have more time to dig on it, sorry.

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of Andreas Weber
Sent: Monday, October 31, 2005 10:19 AM
To: [email protected]
Subject: RE: [flexcoders] Repeater inside TabNavigator, manipulated by class

 

I'm reposting this as I didn't have any luck during the weekend.
Is this a bug or am I just not using it properly?
If it is a bug: is there a workaround to create those tabs on the fly?

Cheers!
--------------
Andreas Weber
motiondraw.com


-----Original Message-----
From: [email protected] [mailto:[email protected]]On
Behalf Of Andreas Weber
Sent: Saturday, October 29, 2005 8:55 PM
To: Flexcoders
Subject: [flexcoders] Repeater inside TabNavigator, manipulated by class


I'm using a simple Array of objects as dataProvider of a Repeater.
When updating the Array from a class I run into an odd problem:
the Repeater works and updates fine when I use it outside a TabNavigator -
inside the TabNavigator I get an  "Error #1009: null has no properties."
(See code and complete error message below)

Thanks for any insight!

--------------
Andreas Weber
motiondraw.com

<?xml version="1.0"?>
<mx:Application  xmlns:mx="http://www.macromedia.com/2005/mxml"
creationComplete="init()">

    <mx:Script>
    <![CDATA[
            [Bindable]
            public var projectFiles =[{filename:"orig", content:"some
content"}];


            import TestClass;

            private function init():Void{
                 public var myTestClass:TestClass = new TestClass();
            }
    ]]>
    </mx:Script>
    <mx:ArrayCollection id="myAC" source="{projectFiles}"/>

      <mx:Repeater  id="repeater1" dataProvider="{myAC}">
         <mx:Button label="{repeater1.currentItem.filename},
{repeater1.currentItem.content}"
/>
    </mx:Repeater>

    <mx:TabNavigator id="tabNav" width="100%" height="100%">
           <mx:Repeater  id="repeater2" dataProvider="{myAC}">
                 <mx:Canvas label="{repeater2.currentItem.filename}">
                     <mx:TextArea width="100%" height="100%"
htmlText="{repeater2.currentItem.content}">
                        </mx:TextArea>
               </mx:Canvas>
          </mx:Repeater>
    </mx:TabNavigator>

</mx:Application>


-----------------------------------------------

TestClass.as


package {
      public class TestClass {
            private var app = mx.core.Application.application;

            public function TestClass(){

                  app.projectFiles =[{filename:"about1", content:"the
content of about 1"},
                              {filename:"about2", content:"the content of
about 2"},
                              {filename:"about3", content:"the content of
about 3"},
                              {filename:"about4", content:"the content of
about 4"}];

            }
      }
}

--------------------------

TypeError: Error #1009: null has no properties.
      at mx.core::Repeater/Repeater$410$private::getIndexForFirstChild()
      at mx.core::Repeater/Repeater$410$private::recreate()
      at mx.core::Repeater/Repeater$410$private::execute()
      at mx.core::Repeater/Repeater$410$private::sort()
      at mx.core::Repeater/Repeater$410$private::collectionChangedHandler()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.collections::ListCollectionView/dispatchEvent()
      at mx.collections::ListCollectionView/refresh()
      at
mx.collections::ListCollectionView/http://www.macromedia.com/2005/flex/mx/in
ternal::reset()
      at mx.collections::ListCollectionView/set list()
      at mx.collections::ArrayCollection/set source()
      at MethodInfo-552()
      at mx.binding::Binding/execute()
      at mx.binding::Binding/watcherFired()
      at mx.binding::Watcher/notifyListeners()
      at mx.binding::PropertyWatcher/handleEvent()
      at flash.events::EventDispatcher/dispatchEvent()
      at test2/set projectFiles()
      at TestClass$iinit()
      at test2/test2$374$private::init()
      at test2/___Application0_creationComplete()
      at flash.events::EventDispatcher/dispatchEvent()
      at
mx.core::UIComponent/mx.core:UIComponent$protected::dispatchCreationComplete
Event()
      at
mx.core::UIComponent$/http://www.macromedia.com/2005/flex/mx/internal::dispa
tchCreationCompleteEvents()
      at
mx.managers::LayoutManager/LayoutManager$1689$private::doPhasedInstantiation
()
      at
mx.core::UIComponent/UIComponent$480$private::callLaterDispatcher2()
      at mx.core::UIComponent/UIComponent$480$private::callLaterDispatcher()





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS

Visit your group "flexcoders" on the web.

To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to