RE: [flexcoders] Re: Repeater and Web Services (Flex 2b1)
Yeah, it's sounding like a bug to me too. Do your workaround for now and let's see if it's fixed in B2. Matt -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Manish Jethani Sent: Thursday, March 09, 2006 1:44 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Repeater and Web Services (Flex 2b1) On 3/9/06, Tim Sawyer <[EMAIL PROTECTED]> wrote: > Assign collection to dataprovider = no event firing. Simply reassigning the Repeater's dataProvider should work. Otherwise it's a bug. Manish -- 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 -- 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 <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Re: Repeater and Web Services (Flex 2b1)
On 3/9/06, Tim Sawyer <[EMAIL PROTECTED]> wrote: > Assign collection to dataprovider = no event firing. Simply reassigning the Repeater's dataProvider should work. Otherwise it's a bug. Manish -- 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 <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Re: Repeater and Web Services (Flex 2b1)
Hi! The difference between your code and mine was that I set a temp variable, made all the changes on the temp, and then assigned the temp to the bound variable. I don't know why, but assigning the changed temp variable seemed to react differently than changing the actual bound variable. I'm not sure why excecuteBindings did not work for you. It almost always worked for me. Are you sure you are getting data back from your service? -- Carolyn At 12:58 PM 3/8/2006, you wrote: Thanks for that. executeBindings() didn't work though, it just didn't seem to fire the event. :-( My original mail below has me doing: > > private function populateCategoryList(event : ResultEvent) : void > > { > > tabsDataProvider = new ArrayCollection(); > > var lResults : ArrayCollection = new > ArrayCollection(event.result); > > var lIndex:int; > > for (lIndex = 0; lIndex < lResults.length; lIndex++) > > { > > tabsDataProvider.addItem(lResults.getItemAt(lIndex)); > > } > > } which I think is the same as your other suggestion. This gives me a null error. Any more ideas appreciated, or is this a bug? ta, Tim. --- In flexcoders@yahoogroups.com, Carolyn Cole <[EMAIL PROTECTED]> wrote: > > Hi! > > I know this may not be the "right" way, but you can call > myCategories.executeBindings() > or > I found if I made a new Object added the data to that and then set the > bound object to that: > var tmpArray = new ArrayCollection(); > var lResults : ArrayCollection = new > ArrayCollection(event.result); > var lIndex:int; > for (lIndex = 0; lIndex < lResults.length; lIndex++) > { > tmpArray.addItem(lResults.getItemAt(lIndex)); > } > tabsDataProvider = tmpArray; > I'm not sure if the above will work some times it did, other times I had to > call executeBindings. > > -- Carolyn > > At 11:24 AM 3/8/2006, you wrote: > >Interesting. > > > >This code: > > > > tabsDataProvider = new ArrayCollection(event.result); > > var lCollectionEvent : CollectionEvent = new CollectionEvent(); > > lCollectionEvent.kind = CollectionEventKind.REFRESH; > > tabsDataProvider.dispatchEvent(lCollectionEvent); > > > >causes the same > > > >TypeError: Error #1009: null has no properties. > > at mx.core::Repeater/mx.core:Repeater::getIndexForFirstChild() > > at mx.core::Repeater/mx.core:Repeater::recreate() > > at mx.core::Repeater/mx.core:Repeater::execute() > > at mx.core::Repeater/mx.core:Repeater::sort() > > at mx.core::Repeater/mx.core:Repeater::collectionChangedHandler() > > > >as before. > > > >Tim. > > > >--- In flexcoders@yahoogroups.com, "Tim Sawyer" wrote: > > > > > > Good plan, but I think I need to be more specific with the event. I get > > > > > > Error: Repeater.collectionChangedHandler: unhandled collectionEvent > > > kind, 500 > > > at > > > > >mx.core::Repeater/mx.core:Repeater::collectionChangedHandler()[C:\dev\beta1\sdk\frameworks\mx\core\Repeater.as:1000] > > > at flash.events::EventDispatcher/dispatchEvent() > > > at > > > > >mx.collections::ListCollectionView/dispatchEvent()[C:\dev\beta1\sdk\frameworks\mx\collections\ListCollectionView.as:701] > > > at > > > > >components::DashBoardTabList/components:DashBoardTabList::populateCategoryList()[C:\dev\HEAD\PRODUCT\websites\MisDashboard\dev\components\DashBoardTabList.mxml:27] > > > at > > > > >()[C:\dev\HEAD\PRODUCT\websites\MisDashboard\dev\services\category\FetchCategoryList.as:24] > > > at flash.events::EventDispatcher/dispatchEvent() > > > at > > > > >mx.rpc::AbstractService/dispatchEvent()[C:\dev\enterprise_beta1\frameworks\mx\rpc\AbstractService.as:144] > > > at > > > > >mx.rpc::AbstractOperation/< http://www.macromedia.com/2005/flex/mx/internal::dispatchRpcEvent()[C:\dev\enterprise_beta1\frameworks\mx\rpc\AbstractOperation.as:162] > http://www.macromedia.com/2005/flex/mx/internal::dispatchRpcEvent()[C:\dev\enterprise_beta1\frameworks\mx\rpc\AbstractOperation.as:162 ] > > > at > > > > >mx.rpc::AbstractInvoker/< http://www.macromedia.com/2005/flex/mx/internal::resultHandler()[C:\dev\enterprise_beta1\frameworks\mx\rpc\AbstractInvoker.as:175] > http://www.macromedia.com/2005/flex/mx/internal::resultHandler()[C:\dev\enterprise_beta1\frameworks\mx\rpc\AbstractInvoker.as:175 ] > > > at flash.events::EventDispatcher/dispatchEvent() > > > at > > > > >mx.rpc::Producer/acknowledge()[C:\dev\enterprise_beta1\frameworks\mx\rpc\Producer.as:69] > > > at > > > > >C:\dev\enterprise_beta1\frameworks\libs\framework.swc(mx/validators/Validator)$132::DirectHTTPMessageResponder/completeHandler()[C:\dev\enterprise_beta1\frameworks\mx\messaging\channels\DirectHTTPChannel.as:277] > > > at flash.events::EventDispatcher/dispatchEvent() > > > at flash.net::URLLoader/flash.net:URLLoader::onComplete() > > > > > > Tim. > > > > > > ---
Re: [flexcoders] Re: Repeater and Web Services (Flex 2b1)
Hi! I know this may not be the "right" way, but you can call myCategories.executeBindings() or I found if I made a new Object added the data to that and then set the bound object to that: var tmpArray = new ArrayCollection(); var lResults : ArrayCollection = new ArrayCollection(event.result); var lIndex:int; for (lIndex = 0; lIndex < lResults.length; lIndex++) { tmpArray.addItem(lResults.getItemAt(lIndex)); } tabsDataProvider = tmpArray; I'm not sure if the above will work some times it did, other times I had to call executeBindings. -- Carolyn At 11:24 AM 3/8/2006, you wrote: Interesting. This code: tabsDataProvider = new ArrayCollection(event.result); var lCollectionEvent : CollectionEvent = new CollectionEvent(); lCollectionEvent.kind = CollectionEventKind.REFRESH; tabsDataProvider.dispatchEvent(lCollectionEvent); causes the same TypeError: Error #1009: null has no properties. at mx.core::Repeater/mx.core:Repeater::getIndexForFirstChild() at mx.core::Repeater/mx.core:Repeater::recreate() at mx.core::Repeater/mx.core:Repeater::execute() at mx.core::Repeater/mx.core:Repeater::sort() at mx.core::Repeater/mx.core:Repeater::collectionChangedHandler() as before. Tim. --- In flexcoders@yahoogroups.com, "Tim Sawyer" <[EMAIL PROTECTED]> wrote: > > Good plan, but I think I need to be more specific with the event. I get > > Error: Repeater.collectionChangedHandler: unhandled collectionEvent > kind, 500 > at > mx.core::Repeater/mx.core:Repeater::collectionChangedHandler()[C:\dev\beta1\sdk\frameworks\mx\core\Repeater.as:1000] > at flash.events::EventDispatcher/dispatchEvent() > at > mx.collections::ListCollectionView/dispatchEvent()[C:\dev\beta1\sdk\frameworks\mx\collections\ListCollectionView.as:701] > at > components::DashBoardTabList/components:DashBoardTabList::populateCategoryList()[C:\dev\HEAD\PRODUCT\websites\MisDashboard\dev\components\DashBoardTabList.mxml:27] > at > ()[C:\dev\HEAD\PRODUCT\websites\MisDashboard\dev\services\category\FetchCategoryList.as:24] > at flash.events::EventDispatcher/dispatchEvent() > at > mx.rpc::AbstractService/dispatchEvent()[C:\dev\enterprise_beta1\frameworks\mx\rpc\AbstractService.as:144] > at > mx.rpc::AbstractOperation/ http://www.macromedia.com/2005/flex/mx/internal::dispatchRpcEvent()[C:\dev\enterprise_beta1\frameworks\mx\rpc\AbstractOperation.as:162] > at > mx.rpc::AbstractInvoker/ http://www.macromedia.com/2005/flex/mx/internal::resultHandler()[C:\dev\enterprise_beta1\frameworks\mx\rpc\AbstractInvoker.as:175] > at flash.events::EventDispatcher/dispatchEvent() > at > mx.rpc::Producer/acknowledge()[C:\dev\enterprise_beta1\frameworks\mx\rpc\Producer.as:69] > at > C:\dev\enterprise_beta1\frameworks\libs\framework.swc(mx/validators/Validator)$132::DirectHTTPMessageResponder/completeHandler()[C:\dev\enterprise_beta1\frameworks\mx\messaging\channels\DirectHTTPChannel.as:277] > at flash.events::EventDispatcher/dispatchEvent() > at flash.net::URLLoader/flash.net:URLLoader::onComplete() > > Tim. > > --- In flexcoders@yahoogroups.com, "Geoffrey Williams" wrote: > > > > Try: > > > > tabsDataProvider = new ArrayCollection(event.result); > > tabsDataProvider.dispatchEvent (new CollectionEvent ()); > > > > -Original Message- > > From: flexcoders@yahoogroups.com [ mailto:flexcoders@yahoogroups.com] On > > Behalf Of Tim Sawyer > > Sent: Wednesday, March 08, 2006 7:25 AM > > To: flexcoders@yahoogroups.com > > Subject: [flexcoders] Repeater and Web Services (Flex 2b1) > > > > I'm having a problem trying to get a set of tabs generated from a web > > service. Full code for my component is pasted at the end of the > message. > > > > The problem is down to getting the results from the web service and > > getting the tabs to rebuild from that list. > > > > If I do: > > > > tabsDataProvider = new ArrayCollection(event.result); > > > > then the tabs aren't rebuilt, presumably because the Repeater doesn't > > notice the list has changed. > > > > If I add individual objects to the tabsDataProvider, which is an > > ArrayCollection, using a for loop (see code later) then the event does > > fire as expected and I get a runtime error: > > > > TypeError: Error #1009: null has no properties. > > at mx.core::Repeater/mx.core:Repeater::getIndexForFirstChild() > > at mx.core::Repeater/mx.core:Repeater::recreate() > > at mx.core::Repeater/mx.core:Repeater::execute() > > at mx.core::Repeater/mx.core:Repeater::collectionChangedHandler() > > at flash.events::EventDispatcher/dispatchEvent() > > at mx.collections::ListCollectionView/dispatchEvent() > > at > > > mx.collections::ListCollectionView/mx.collections:ListCollectionView::addIte > > msToView() > > at > > > mx.collections::ListCollectionView/mx.collections:List