History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-14857
Type: Bug Bug
Status: Under Investigation Under Investigation
Priority: C C
Assignee: SDK Community
Reporter: Peter deHaan (Adobe)
Votes: 2
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Flex SDK

Can't change selectedIndex of LinkBar control in ActionScript if initial value set in MXML (when using Array as data provider)

Created: 03/04/08 03:44 PM   Updated: 03/12/09 06:30 PM
Component/s: mx: LinkBar
Security Level: Public (All JIRA Users )

File Attachments: 1. Text File LinkBar_test.mxml (0.9 kb)
2. File LinkBar_test.swf (309 kb)

Issue Links:
Relationship
This issue relates to:
SDK-8081 [Beta] selectedIndex is not working f... C Closed
 

Severity: Usability Issue
Reproducibility: Every Time
Discoverability: Medium
Found in Version: SDK Flex 3 (Released)
Milestone: SDK Community Fix Candidates
Affected OS(s): All OS Platforms - All
Steps to Reproduce:
Steps to reproduce:
1. Compile and run attached code.
2. Click on various items in the LinkBar

 
Actual Results:
selectedIndex was set in MXML and turns the last link item grey. If you try to set the selectedIndex property using ActionScript, the value changes, but not the control itself.


Expected Results:
Either ignore the selectedIndex set in MXML if the data provider is an Array of strings/objects, or allow the user to dynamically set the selectedIndex style using ActionScript.


Workaround (if any):
none found
Language Found: English
Bugbase Id: none
Triaged: Yes
Regression: No
QA Owner: Ella Mitelman
Participants: Ella Mitelman, Joan Lafferty, John Clark, Lauren Park, Patrick Tai, Peter deHaan (Adobe) and SDK Community


 All   Comments      Sort Order:
Peter deHaan (Adobe) - [03/04/08 03:45 PM ]
(Added related/similar bug)

Peter deHaan (Adobe) - [03/04/08 03:46 PM ]
Able to repro in 201.3 and Flex 3

Patrick Tai - [03/10/08 10:21 AM ]
As a temporary workaround, I would suggest to extend Link bar and override the clickHandler function as follow.
NOTE: I haven't test it on dataprovider other than array or viewstack.

package com.fix.controls
{
import mx.controls.LinkBar;
import mx.controls.Button;
import flash.events.MouseEvent;


public class ExtLinkBar extends LinkBar
{
public function ExtLinkBar ()
{
super();
}


override protected function clickHandler(event:MouseEvent):void
     {
        var index:int = getChildIndex(Button(event.currentTarget));


            if (index == selectedIndex)
                hiliteSelectedNavItem(-1);
                
            else
                hiliteSelectedNavItem(index);

        super.clickHandler(event);
    }

}
}

Joan Lafferty - [03/26/08 12:59 PM ]
This seems like basic functionality for LinkBar, we should try to fix it in the next release. Just my 2 cents.

Ella Mitelman - [06/20/08 12:24 PM ]
Fix for 3.0.x"

Lauren Park - [10/08/08 09:10 AM ]
Investigate fixing for Flex 4.

John Clark - [10/27/08 11:35 AM ]
The problem does not stop here!
Build a project add a view stack and some canvas items.
Add a HBox to the project which contains some buttons
add click event handling
click="vs.selectedIndex = 1;"
everything works
Now add an event handler to do some work prior to running the selected click event

private function myHandleClick(event:Event):void {
doSomething
vs.selectedIndex = 1;"
doSomethingElse

call the event from the button
click="myHandleClick(event);"
the vs.selectedIndex flips (gets the last item)
now how silly is that!

John Clark


Lauren Park - [02/26/09 09:04 PM ]
SDK Community Fix Candidate.