I have a spark List with hasFocusableChildren is true and a custom renderer
that has a TextInput field. I set focus to a row and then start tabbing
through the list, when it gets to the last visible row, the next tab causes
focus to leave the List. How do I get the list to scroll into view the next
row? The same thing also happens when shift-tabbing backup the list and the
very first row is not currently visible.
Attached is some code that demonstrates the problem.
Chris
--
Chris Velevitch
Manager - Adobe Developers & Designers, Sydney
m: 0415 469 095
Adobe Developers & Designers, Sydney
Topic: Lucee
Date: Mon, 28th September
Details and RSVP on http://www.meetup.com/Adobe-developers-designers-sydney/
<?xml version="1.0"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
height="500" width="500"
creationComplete="creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import mx.collections.ArrayList;
import mx.events.FlexEvent;
private var values:ArrayList = new ArrayList();
private function creationCompleteHandler(event:FlexEvent):void
{
for (var i:int = 0; i < 100; i++)
values.addItem(String(i));
}
]]>
</fx:Script>
<s:VGroup height="100%">
<s:Button label="Top of List"/>
<s:List id="editList" dataProvider="{values}" height="100%"
hasFocusableChildren="true">
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:HGroup paddingLeft="4" verticalAlign="middle">
<s:Label text="{data}" width="30"/>
<s:TextInput text="{data}" tabEnabled="true"/>
</s:HGroup>
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
<s:Button label="Bottom of List" />
</s:VGroup>
</s:Application>