http://tech.groups.yahoo.com/group/flexcoders/message/90981 :D
--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote: > > DisplayObjects already have a 'name' property. Flex makes some > assumptions about what is in it, and if you set it via binding you run > the risk of the binding firing when the dataprovider isn't set which > would probably stick a null in there. > > > > If you can use some other property name like 'id' or something like that > it would probably be safer and then you can just check > event.currentTarget.id. It probably doesn't matter that the data > provider items have a 'name' property, you probably just have to map it > to a property on the display objects that isn't 'name'. > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Ryan > Sent: Wednesday, October 17, 2007 10:16 AM > To: [email protected] > Subject: [flexcoders] Re: Very strange runtime error with a repeater. > > > > I guess a little more explanation might help: > > the element in question is clickable. If someone clicks on it, my event > handler will look at > event.currentTarget.name to see what the name of the repeater item was, > so I can work > with it. > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> > , "Ryan" <ryan@> wrote: > > > > In this case, name is used as an identifier that I can't get around, > unless there's another > > attribute that I can set a text value on and draw from... > > > > Any ideas there? > > > > > > --- In [email protected] > <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <aharui@> wrote: > > > > > > In general, you should not have a 'name' property on things that > > > subclass DisplayObject. One already exists and it is used for > various > > > things in Flex. > > > > > > > > > > > > ________________________________ > > > > > > From: [email protected] > <mailto:flexcoders%40yahoogroups.com> > [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> > ] On > > > Behalf Of Ryan > > > Sent: Wednesday, October 17, 2007 9:49 AM > > > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > > > > Subject: [flexcoders] Re: Very strange runtime error with a > repeater. > > > > > > > > > > > > lol another correction, i meant name="myRepeater.name_element". > > > > > > The odd thing is that I can ADD as much data to the dataprovider as > I > > > want and re- > > > executebindings all day, but if I remove ANY single element from the > > > array or just clear > > > the whole dataprovider array, the thing errors. > > > > > > --- In [email protected] > <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> > > > , "Ryan" <ryan@> wrote: > > > > > > > > Correction, I do not have a name property set in the PROVIDER, but > in > > > the repeater > > > there's > > > > a name attribute on of one of the components that's set like > > > > name="mydataprovider.name_element" If I clear out the data it > > > shouldn't cause this > > > > problem because the repeater shouldn't go through any iterations. > If I > > > remove one of > > > the > > > > elements in my array, the rest still have the "name_element" set > so it > > > shouldn't be a > > > > problem in that case either.... > > > > > > > > Unless of course there's something I don't know about using a > "name" > > > in a repeater or > > > > something like that. > > > > > > > > --- In [email protected] > <mailto:flexcoders%40yahoogroups.com> > > > <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <aharui@> > wrote: > > > > > > > > > > Do you have a 'name' property in your data provider objects? > > > > > > > > > > > > > > > > > > > > ________________________________ > > > > > > > > > > From: [email protected] > <mailto:flexcoders%40yahoogroups.com> > > > <mailto:flexcoders%40yahoogroups.com> > > > [mailto:[email protected] > <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> > > > ] On > > > > > Behalf Of Ryan > > > > > Sent: Monday, October 15, 2007 4:29 PM > > > > > To: [email protected] > <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> > > > > > > > > Subject: [flexcoders] Very strange runtime error with a > repeater. > > > > > > > > > > > > > > > > > > > > I've used repeaters before so I definitely know how they work as > a > > > > > whole. I've never had > > > > > the issue I'm about to describe and I've been fruitless in my > search > > > > > efforts. > > > > > > > > > > I have built a custom-component (sort-of a menu) that uses a > > > repeater to > > > > > list out the > > > > > menu items. In the mxml I've set its dataProvider to > > > (hypothetically) > > > > > this.parentDocument.myArray (also tried parentApplication out of > > > > > desperation which didn't > > > > > help at all). When i place items into that array I can do > > > > > myComponent.myRepeater.executeBindings and the new items show up > > > just > > > > > fine. > > > > > > > > > > The problem comes when I want to completely clear the list, > remove > > > an > > > > > element of it, or > > > > > set the list to something else (myArray = myOtherArray). > Whenever I > > > do > > > > > any of these and > > > > > then attempt to execute bindings, i get a huge error > message...which > > > > > follows: > > > > > > > > > > TypeError: Error #2007: Parameter name must be non-null. > > > > > at flash.display::DisplayObject/set name() > > > > > at MethodInfo-2196() > > > > > at MethodInfo-1590() > > > > > at Function/http://adobe.com/AS3/2006/builtin::apply > <http://adobe.com/AS3/2006/builtin::apply> > > > <http://adobe.com/AS3/2006/builtin::apply > <http://adobe.com/AS3/2006/builtin::apply> > > > > > > <http://adobe.com/AS3/2006/builtin::apply > <http://adobe.com/AS3/2006/builtin::apply> > > > <http://adobe.com/AS3/2006/builtin::apply > <http://adobe.com/AS3/2006/builtin::apply> > > () > > > > > at mx.binding::Binding/mx.binding:Binding::wrapFunctionCall() > > > > > at mx.binding::RepeatableBinding/::recursivelyProcessIDArray() > > > > > at mx.binding::RepeatableBinding/::recursivelyProcessIDArray() > > > > > at mx.binding::RepeatableBinding/execute() > > > > > at mx.binding::Binding/watcherFired() > > > > > at mx.binding::Watcher/notifyListeners() > > > > > at mx.binding::PropertyWatcher/eventHandler() > > > > > at > > > > > > > > > flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven > > > > > tFunction() > > > > > at flash.events::EventDispatcher/dispatchEvent() > > > > > at mx.core::UIComponent/dispatchEvent() > > > > > at mx.core::Repeater/set dataProvider() > > > > > at MethodInfo-2194() > > > > > at Function/http://adobe.com/AS3/2006/builtin::call > <http://adobe.com/AS3/2006/builtin::call> > > > <http://adobe.com/AS3/2006/builtin::call > <http://adobe.com/AS3/2006/builtin::call> > > > > > > <http://adobe.com/AS3/2006/builtin::call > <http://adobe.com/AS3/2006/builtin::call> > > > <http://adobe.com/AS3/2006/builtin::call > <http://adobe.com/AS3/2006/builtin::call> > > () > > > > > at mx.binding::Binding/::innerExecute() > > > > > at Function/http://adobe.com/AS3/2006/builtin::apply > <http://adobe.com/AS3/2006/builtin::apply> > > > <http://adobe.com/AS3/2006/builtin::apply > <http://adobe.com/AS3/2006/builtin::apply> > > > > > > <http://adobe.com/AS3/2006/builtin::apply > <http://adobe.com/AS3/2006/builtin::apply> > > > <http://adobe.com/AS3/2006/builtin::apply > <http://adobe.com/AS3/2006/builtin::apply> > > () > > > > > at mx.binding::Binding/mx.binding:Binding::wrapFunctionCall() > > > > > at mx.binding::Binding/execute() > > > > > at mx.binding::BindingManager$/executeBindings() > > > > > at mx.core::UIComponent/executeBindings() > > > > > at index/appClosed() > > > > > at pages/__launchCloseButton_click() > > > > > > > > > > For clarity, ALL I'm doing is running executeBindings() and this > > > > > happens. I've verified over > > > > > and over that the data in my dataProvider array is clean and > > > correct. > > > > > > > > > > The only difference between this repeater and ones I've done in > the > > > past > > > > > is that this > > > > > repeater is part of a custom component instead of part of my > main > > > mxml > > > > > program. I can't > > > > > imagine why this would be creating any issues, but whether or > not > > > it's > > > > > related to that, I'd > > > > > be VERY appreciative of any help that you all could give. I've > been > > > > > working on this on and > > > > > off for four days now and I can't seem to get anywhere with it. > > > > > > > > > > Thanks, RV > > > > > > > > > > > > > > >

