Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Adobe Flex SDK 4.0 (Release)
-
None
-
None
-
Affected OS(s): All OS Platforms
Browser: Firefox 3.x
Language Found: English
Description
I reopened this because like the other people who filed and commented on this bug, I too have spent many hours tracking down nasty selection problems only to discover that something so incredibly easy to fix was the root cause. Honestly, looking at the code it looks like someone was rushing and didn't finish the job.
Not only should this function work, as it is a documented setter, but it causes signficant painful side effects. It is also very likely the cause of other bugs, such as SDK-26001, which is currently unresolved.
Please do not close this ticket without fixing the bug. Note that the fix is VERY SIMPLE (You just add line of code - set openItemsChanged to false).
The fix is described in the original ticket:
https://bugs.adobe.com/jira/browse/SDK-23388
I have tested it. The fix works. I had to clone the entire Tree class just to work around this bug, which seems ridiculous.
The workaround is not reasonable given these issues.
From the original bug post:
-----------------------------------------
Steps to reproduce:
1. set openItems with a hierarchy of nodes that you would like to open.
2. do practically anything else, that will result in a call to invalidateProperties
3. commitProperties will then be called which will reset the dataprovider on every successive commitProperties
4. this cause a CollectionEvent.RESET
5. this will cause the selection to be lost.
Actual Results:
The data provider is set in Tree every time commitProperties is called! This is bad.
Also, selection should not be lost. Caused much grief in our app.
Workaround (if any):
use expandItem or expandChildrenOf instead.
if you use expandItem, you will have to expand the whole hierarchy, from the top down., This is a bit of a pain.
if you use expandChildrenOf, this expands all children on each level, which may not be what you want.
it would be far easier if I could set openItem on the tree.
can't fix this by extending Tree
unless mx.Tree is about to be replaced by something else entirely
in the next SDK release, you should fix this