RE: [flexcoders] TileList.selectedIndices problem
Well, I finally got around to looking at this. It is the same problem, in initGridView you are setting selectedIndices when dataProvider.length == 0. I would just defend against that. private function initGridView(selectedIndex:Number, indices:Array):void { if (indices.length 0 grid.dataProvider.length 0) { //grid.selectedIndex = selectedIndex; grid.selectedIndices = indices; grid.invalidateList(); } updateStatus(); } From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Charles Galpin Sent: Wednesday, October 03, 2007 10:55 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] TileList.selectedIndices problem I'd like nothing more than to be proven wrong and eat crow on this, but I have changed the view handling to be more explicit, and make sure the indices are being saved from the current view before the view is switched, and then set when the next view is visible, and there is no change. You can see the grid.selectedIndices being passed an array of indices, and afterwards still being empty. After that point the grid.selectedIndices is always empty despite your selections. I stepped through the ListBase code, but can't tell what the issue is. V2 is here. Just set a breakpoint in Problem.mxml on line 162 to see what happens when you undo the delete. http://labs.lhsw.com/~cgalpin/flex/Problem2/bin/Problem.html http://labs.lhsw.com/~cgalpin/flex/Problem2/bin/Problem.html thanks charles On Oct 2, 2007, at 6:11 PM, Alex Harui wrote: I'd have to build it and step through it which I don't have time to do right now, but I'm suspicious of having centralized selectedIndices properties that point to the tilelist or grid. Seems like it could return the wrong one when switching
Re: [flexcoders] TileList.selectedIndices problem
I'd like nothing more than to be proven wrong and eat crow on this, but I have changed the view handling to be more explicit, and make sure the indices are being saved from the current view before the view is switched, and then set when the next view is visible, and there is no change. You can see the grid.selectedIndices being passed an array of indices, and afterwards still being empty. After that point the grid.selectedIndices is always empty despite your selections. I stepped through the ListBase code, but can't tell what the issue is. V2 is here. Just set a breakpoint in Problem.mxml on line 162 to see what happens when you undo the delete. http://labs.lhsw.com/~cgalpin/flex/Problem2/bin/Problem.html thanks charles On Oct 2, 2007, at 6:11 PM, Alex Harui wrote: I'd have to build it and step through it which I don't have time to do right now, but I'm suspicious of having centralized selectedIndices properties that point to the tilelist or grid. Seems like it could return the wrong one when switching
Re: [flexcoders] TileList.selectedIndices problem
Done, https://bugs.adobe.com/jira/browse/SDK-12870 thanks charles On Oct 1, 2007, at 7:48 PM, Alex Harui wrote: It is a bug that you can have selectedIndices but that selectedIndex = -1. Please file a bug for that. Thanks, -Alex
Re: [flexcoders] TileList.selectedIndices problem
Sorry, try now. charles On Oct 2, 2007, at 5:38 PM, Alex Harui wrote: Your viewsource link is not working. This slightly more complex test case (right click to see source) shows it nicely though if you follow the steps above http://labs.lhsw.com/~cgalpin/flex/Problem/bin/Problem.html totally stumped... charles
RE: [flexcoders] TileList.selectedIndices problem
I'd have to build it and step through it which I don't have time to do right now, but I'm suspicious of having centralized selectedIndices properties that point to the tilelist or grid. Seems like it could return the wrong one when switching. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Charles Galpin Sent: Tuesday, October 02, 2007 2:46 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] TileList.selectedIndices problem Sorry, try now. charles On Oct 2, 2007, at 5:38 PM, Alex Harui wrote: Your viewsource link is not working. This slightly more complex test case (right click to see source) shows it nicely though if you follow the steps above http://labs.lhsw.com/~cgalpin/flex/Problem/bin/Problem.html http://labs.lhsw.com/~cgalpin/flex/Problem/bin/Problem.html totally stumped... charles
Re: [flexcoders] TileList.selectedIndices problem
If you can find the time at some point, please do. I simply made that as a convenience to not have to do the check to see what view is active but I sure it's being used appropriately. I'll double check, but I did put a breakpoint in it and double checked everything is doing what I expect each time it is called. charles On Oct 2, 2007, at 6:11 PM, Alex Harui wrote: I'd have to build it and step through it which I don't have time to do right now, but I'm suspicious of having centralized selectedIndices properties that point to the tilelist or grid. Seems like it could return the wrong one when switching. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Charles Galpin Sent: Tuesday, October 02, 2007 2:46 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] TileList.selectedIndices problem Sorry, try now. charles On Oct 2, 2007, at 5:38 PM, Alex Harui wrote: Your viewsource link is not working. This slightly more complex test case (right click to see source) shows it nicely though if you follow the steps above http://labs.lhsw.com/~cgalpin/flex/Problem/bin/Problem.html totally stumped... charles
Re: [flexcoders] TileList.selectedIndices problem
Whoohoo, thank you much! charles On Oct 1, 2007, at 4:14 PM, Alex Harui wrote: You fell into a hole created by our attempt to allow you to specify selectedIndex/Indices on the MXML tag and set the collection later after a server fetch. Having a collection of length=0 queues the selection request so it got applied after you set it later. A workaround would be: // simulate delete all then add back dataCollection.removeAll(); if ( clearData.selected ) list.selectedIndices = new Array(); list.invalidateList(); setData(); if ( clearData.selected ) list.validateNow();
Re: [flexcoders] TileList.selectedIndices problem
Oh, one more question on this Alex. If you run the test, you'll see the selectedIndex changes when setting the selectedIndices. I don't show it in this example but even if I saved it off (-1) and set it, it will still change to 0. I bothers me that it's not symmetric - not sure if it's a problem or not. thanks charles On Oct 1, 2007, at 4:14 PM, Alex Harui wrote: You fell into a hole created by our attempt to allow you to specify selectedIndex/Indices on the MXML tag and set the collection later after a server fetch. Having a collection of length=0 queues the selection request so it got applied after you set it later. A workaround would be: // simulate delete all then add back dataCollection.removeAll(); if ( clearData.selected ) list.selectedIndices = new Array(); list.invalidateList(); setData(); if ( clearData.selected ) list.validateNow();
RE: [flexcoders] TileList.selectedIndices problem
It is a bug that you can have selectedIndices but that selectedIndex = -1. Please file a bug for that. Thanks, -Alex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Charles Galpin Sent: Monday, October 01, 2007 4:24 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] TileList.selectedIndices problem Oh, one more question on this Alex. If you run the test, you'll see the selectedIndex changes when setting the selectedIndices. I don't show it in this example but even if I saved it off (-1) and set it, it will still change to 0. I bothers me that it's not symmetric - not sure if it's a problem or not. thanks charles On Oct 1, 2007, at 4:14 PM, Alex Harui wrote: You fell into a hole created by our attempt to allow you to specify selectedIndex/Indices on the MXML tag and set the collection later after a server fetch. Having a collection of length=0 queues the selection request so it got applied after you set it later. A workaround would be: // simulate delete all then add back dataCollection.removeAll(); if ( clearData.selected ) list.selectedIndices = new Array(); list.invalidateList(); setData(); if ( clearData.selected ) list.validateNow();