Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Later
-
Adobe Flex SDK Previous
-
None
-
None
-
Language Found: English
Description
Current function "createNavItem" in LinkBar component accept only label and icon Class arguments. In my custom LinkBar component I cannot reused that function:
1) New newLink:Button in my code has more attributes. To assign these attributes I need to know dataProvider index. var data:Object = dataProvider[index]
2) In some cases I don't need separator between buttons. I tried to set style separatorSkin=null it does not help.
My suggestion to change current function and assign more attributes:
override protected function createNavItem(
dataIndex:int,
label:String,
icon:Class = null,
showSeparator = true):IFlexDisplayObject
in SDK:
override protected function createNavItem(
label:String,
icon:Class = null):IFlexDisplayObject
Workarounds:
1) I can hide separator if will assign separatorWidth = 0
2) I can find child component iterating children, BUT that will work ONLY if icon and label are unique.
var button:Button = super.createNavItem(label, icon) as Button;
var numViews:int = targetStack.numChildren;
for (var i:int = 0; i < numViews; i++){
var child:Container = Container(targetStack.getChildAt);
if(itemToLabel(child) == button.label && child.icon == button.getStyle('icon'))
}