Just wanted to follow this up with the solution. After chasing dead ends for
awhile (and learning more about the inner workings of ListCollectionView,) I
finally realized that (duh) I wasn't calling refresh() on the view after
setting my sorts! I'm using Uday Shankar's excellent CGrid component, and I
thought there was a sort applied inside that, but I was wrong. That's what I
get for coding at night I guess :)

Still having problems with seeing framework source in the debug view, but
I'll post that in another topic.

On Tue, Mar 11, 2008 at 11:55 PM, Ken Dunnington <[EMAIL PROTECTED]>
wrote:

> Okay, when it rains it pours... I cannot get the source lookup to work in
> the debugging view. I've manually set the source lookup to the "Flex Builer
> 3 Plug-in/sdks/3.0.0/frameworks/projects/framework/src" directory with
> "search subfolders" turned on, but none of the framework classes are
> available for viewing through the debugger (and thus no line numbers show up
> in the stack trace.) I've reinstalled the FB3 plugin to no avail. This has
> worked in the past, but I can't recall when it stopped as I didn't use the
> feature much.
>
> I can't figure out why this is happening, but now it's making it difficult
> to debug my original issue. Any ideas how I can reconnect the framework
> source to Flex Builder?
>
>
> On Tue, Mar 11, 2008 at 10:21 AM, Ken Dunnington <[EMAIL PROTECTED]>
> wrote:
>
> > Considering I had to look that up, probably not. :) The docs say
> > -optimize is true by default, or are you talking about something besides the
> > compiler arg?
> >
> > I'll have to try again tonight, as for some reason the SWF isn't
> > connecting to the debugger - my other projects connect without issue, so
> > I'll try it on my home computer, where I'm doing active development on this
> > project.
> >
> >
> > On Tue, Mar 11, 2008 at 12:59 AM, Alex Harui <[EMAIL PROTECTED]> wrote:
> >
> > >    Is your project set to optimize?  We should be seeing line numbers
> > > for the ListCollectionView classes as well, which is what I want to know.
> > >
> > >
> > >  ------------------------------
> > >
> > > *From:* [email protected] [mailto:[EMAIL PROTECTED]
> > > *On Behalf Of *Ken Dunnington
> > > *Sent:* Monday, March 10, 2008 7:27 PM
> > > *To:* [email protected]
> > > *Subject:* Re: [flexcoders] IViewCursor.findAny on a typed object?
> > >
> > >
> > >
> > > Sure thing:
> > >
> > > TypeError: Error #1009: Cannot access a property or method of a null
> > > object reference.
> > >     at
> > > mx.collections::ListCollectionView/http://www.adobe.com/2006/flex/mx/internal::findItem
> > > ()
> > >     at ListCollectionViewCursor/findAny()
> > >     at com.rpmchallenge.view.PlayerParts::Transport/updateSong
> > > ()[/Users/ken/dev/Jukebox/src/com/rpmchallenge/view/PlayerParts/Transport.mxml:211]
> > >     at mx.binding.utils::ChangeWatcher/wrapHandler()
> > >     at flash.events::EventDispatcher/dispatchEventFunction()
> > >     at flash.events::EventDispatcher/dispatchEvent()
> > >     at 
> > > com.rpmchallenge.model::ModelLocator/setselectedTrack()[/Users/ken/dev/Jukebox/src/com/rpmchallenge/model/ModelLocator.as:25]
> > >     at com.rpmchallenge.view::Main/updateSelectedTrack
> > > ()[/Users/ken/dev/Jukebox/src/com/rpmchallenge/view/Main.mxml:68]
> > >     at flash.events::EventDispatcher/dispatchEventFunction()
> > >     at flash.events::EventDispatcher/dispatchEvent()
> > >     at mx.core::UIComponent/dispatchEvent()
> > >     at mx.controls.listClasses::ListBase/mouseDoubleClickHandler()
> > >
> > > As you can see, I'm using a ChangeWatcher to dispatch a
> > > PropertyChangeEvent on my model. Currently, there is only 1 view from 
> > > which
> > > I'm creating my IViewCursor, but in the finished app, there will be many.
> > > The object being watched on the model is an instance variable of the 
> > > model,
> > > so I'm not sure if it equals the same object in memory as the selected
> > > object in the view.
> > >
> > > On Mon, Mar 10, 2008 at 2:33 AM, Alex Harui <[EMAIL PROTECTED]> wrote:
> > >
> > > Use a debug build and post the entire stack trace with line numbers.
> > >
> > >
> > >  ------------------------------
> > >
> > > *From:* [email protected] [mailto:[EMAIL PROTECTED]
> > > *On Behalf Of *Ken Dunnington
> > > *Sent:* Sunday, March 09, 2008 8:28 PM
> > > *To:* [email protected]
> > >
> > >
> > > *Subject:* [flexcoders] IViewCursor.findAny on a typed object?
> > >
> > >
> > >
> > > I'm having trouble getting the findAny() method to work on a simple
> > > typed object. I've applied a single-field sort on my ListCollectionView, 
> > > and
> > > the object I'm trying to find is in the view, but findAny() always returns
> > > an error of: TypeError: Error #1009: Cannot access a property or method 
> > > of a
> > > null object reference. This error is thrown by the
> > > ListCollectionView.findItem() method. I haven't dug out the source
> > > yet, but I'm hoping someone can shed some light on how this method is
> > > supposed to work. Here is the code I'm trying:
> > >
> > >             private function updateSong(e:PropertyChangeEvent):void {
> > >                 var _track:PlaylistItem = e.newValue as PlaylistItem;
> > >                 // Look for the track in the playlist
> > >                 if (playlistCursor.findAny(_track)) {
> > >                     track = playlistCursor.current as PlaylistItem;
> > >                     play();
> > >                 }
> > >             }
> > >
> > > I've also tried looping over the view, using simple comparison (==)
> > > and I can get the item's index, but I don't know how to update the 
> > > cursor's
> > > position without using the findxxx() methods!
> > >
> > > --
> > > The American Republic will endure until the day Congress discovers
> > > that it can bribe the public with the public's money.
> > > -- Alexis de Tocqueville
> > >
> > >
> > >
> > >
> > > --
> > > The American Republic will endure until the day Congress discovers
> > > that it can bribe the public with the public's money.
> > > -- Alexis de Tocqueville
> > >   
> > >
> >
> >
> >
> > --
> > The American Republic will endure until the day Congress discovers that
> > it can bribe the public with the public's money.
> > -- Alexis de Tocqueville
> >
>
>
>
> --
> The American Republic will endure until the day Congress discovers that it
> can bribe the public with the public's money.
> -- Alexis de Tocqueville
>



-- 
The American Republic will endure until the day Congress discovers that it
can bribe the public with the public's money.
-- Alexis de Tocqueville

Reply via email to