Hi,
I can't see what
i've missed here.
In this code i have
a trace in saveState that nevers appears in the console
panel.
<mx:VBox
xmlns:mx="http://www.adobe.com/2006/mxml"
implements="mx.managers.IHistoryManagerClient"
width="400" height="100"
initialize="init()">
xmlns:mx="http://www.adobe.com/2006/mxml"
implements="mx.managers.IHistoryManagerClient"
width="400" height="100"
initialize="init()">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.managers.HistoryManager;
import com.xxx.admin.model.AdminModelLocator ;
/////////////////////////
// IHistoryState methods
/////////////////////////
public function loadState(state:Object):void
<![CDATA[
import mx.collections.ArrayCollection;
import mx.managers.HistoryManager;
import com.xxx.admin.model.AdminModelLocator ;
/////////////////////////
// IHistoryState methods
/////////////////////////
public function loadState(state:Object):void
{
if (state)
if (state)
{
_selectedIndex = state.selectedIndex;
_dataProvider = state.dataProvider;
}
}
public function saveState():Object
_selectedIndex = state.selectedIndex;
_dataProvider = state.dataProvider;
}
}
public function saveState():Object
{
trace('saveState!');
var state:Object = {};
state.selectedIndex = _selectedIndex;
state.dataProvider = _dataProvider;
return state;
}
public function init():void
{
HistoryManager.register(this);
}
public function set dataProvider(value:ArrayCollection):void
{
_dataProvider = value;
HistoryManager.save();
}
public function set selectedIndex(value:Number):void
{
_selectedIndex = value;
HistoryManager.save();
}
[Bindable]
private var model:AdminModelLocator = AdminModelLocator.getInstance();
[Bindable] private var _dataProvider:ArrayCollection;
[Bindable] private var _selectedIndex:Number;
]]>
</mx:Script>
__._,_.___
trace('saveState!');
var state:Object = {};
state.selectedIndex = _selectedIndex;
state.dataProvider = _dataProvider;
return state;
}
public function init():void
{
HistoryManager.register(this);
}
public function set dataProvider(value:ArrayCollection):void
{
_dataProvider = value;
HistoryManager.save();
}
public function set selectedIndex(value:Number):void
{
_selectedIndex = value;
HistoryManager.save();
}
[Bindable]
private var model:AdminModelLocator = AdminModelLocator.getInstance();
[Bindable] private var _dataProvider:ArrayCollection;
[Bindable] private var _selectedIndex:Number;
]]>
</mx:Script>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Software development tool | Software development | Software development services |
Home design software | Software development company |
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___