<?xml version="1.0" encoding="utf-8"?>
<TsAbstructComboBox xmlns="cls.com.ils.biz.component.*" xmlns:mx="http://www.adobe.com/2006/mxml"
	labelField="@name" rowCount="20"
 	arrowButtonWidth="0" iconColor="0xFFFFFF" fillAlphas="[1, 1]" fillColors="[ 0xFFFFFF, 0xFFFFFF ]"
	change="onSelectionChange(event)">
	<mx:Script>
		<![CDATA[
			import mx.events.ListEvent;
			import mx.controls.dataGridClasses.DataGridListData;
			import mx.collections.XMLListCollection;

			import cls.com.ils.biz.model.SharedDataModel;
			
			//　XMLのレイアウト <item name="××××" value="1"/>
			private var _ownerData:XML;
			private var _item:XML = new XML("<item />");
						
			override public function set data(value:Object):void
			{				
				if(value){
					_ownerData = value as XML;
					var col:DataGridListData = DataGridListData(listData);
					var cname:String = value[col.dataField];
					var cvalue:String = value[col.dataField].@value;
					
					_item.@name = cname;
					_item.@value = cvalue;
					
					selectedItem = _item;
				}
			}
			
			// ボタン名ゲッターメソッド
			public function get item():Object{
				return _item;
			}

			override public function get data():Object
			{
				return _ownerData;
			}
			
			override public function setFocus():void
			{
//				selectedItem = _item;
				super.setFocus();
				
//				open();
			}
			
			private function onSelectionChange(e:ListEvent):void
			{
				if(selectedItem && _ownerData){
					
					var col:DataGridListData = DataGridListData(listData);
					var cname:String = selectedItem.@name;
					var cvalue:String = selectedItem.@value;

					_ownerData[col.dataField] = cname;
					_ownerData[col.dataField].@value = cvalue;
				}
			}
			
		]]>
	</mx:Script>	
</TsAbstructComboBox>
