How to make Yahoo ASTRA autocompletemanager pop out last inputed into it value on application creation?(Flash builder, mxml)
So yahoo astra has grate compohent for saving inputed data. They show examples of how to use it. But I had not found one capable to solve my current problem. For example user inputed his name. It is saved, but when he comes again he always needs to input at least first latter of his name. so I wonder - how to make Yahoo astra autocompletemanager component to pop up last inputed into it value on application creation complete?
So for example assume we have:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:yahoo="http://www.yah开发者_开发百科oo.com/astra/2006/mxml" creationComplete="application1_creationCompleteHandler(event)">
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
// make autoCompleteMgr pop up last inputed values
}
]]>
</mx:Script>
<yahoo:AutoCompleteManager
id="autoCompleteMgr"
targets="{[textInput1]}"
shareData="true"
autoSave="true"
/>
<mx:Label x="40" y="37" text="Full Name"/>
<mx:TextInput id="textInput1" left="40" top="53"/>
</mx:Application>
Very simple code. but how to make autoCompleteMgr pop up last inputed values into textInputs into which last time app was used were inputed values?
BTW: I solved it in quite crappy way:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:yahoo="http://www.yahoo.com/astra/2006/mxml" creationComplete="application1_creationCompleteHandler(event)">
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
autoCompleteMgr.openDropdownForTarget(textInput1);
}
]]>
</mx:Script>
<yahoo:AutoCompleteManager
id="autoCompleteMgr"
targets="{[textInput1]}"
shareData="true"
autoSave="true"
caseSensitive="true"
popUpEnabled="true"
minCharsForCompletion="0"
/>
<mx:Label x="40" y="37" text="Full Name"/>
<mx:TextInput id="textInput1" left="40" top="53"/>
</mx:Application>
It looks like there is a autoFillEnabled property on the AutoCompleteManager component
精彩评论