<?xml version="1.0" encoding="utf-8"?>
<!--
////////////////////////////////////////////////////////////////////////////////
// 株式会社　アイエルエス
// Copyright 2008 ILS
// All Rights Reserved.
//
// NOTICE:  
////////////////////////////////////////////////////////////////////////////////
-->
<IlsComboBox  xmlns="cls.com.ils.common.component.*" xmlns:mx="http://www.adobe.com/2006/mxml"
	labelField="@name" rowCount="10" creationComplete="onCreationCompleted();"
	disabledColor="#000000"
	change="onSelectionChange(event)">
	<mx:Script>
		<![CDATA[
			import mx.events.FlexEvent;
			import mx.events.ListEvent;
			import cls.com.ils.biz.model.SharedDataModel;
			
			private var _item:XML = new XML("<item />");

            private var _value:String;

			public var karaItem:Boolean;
			
			private function onCreationCompleted():void{
				
			}
			
			override public function set dataProvider(value:Object):void{
				super.dataProvider = value;
				if(_value){
					dataValue = _value;
//					dispatchEvent(new ListEvent(ListEvent.CHANGE));
				}			
			}
			
//			override public function getSrchOkResponse(cd:String, message:String):void{
//				if(_value){
//					dataValue = _value;
//				}
////				this.enabled = true;
//				
//				dispatchEvent(new ListEvent(ListEvent.CHANGE));
//			}
			
			override public function set text(value:String):void{
	            var len:int = dataProvider.length;
	            for(var i:int = 0; i < len; i++) {
	                if(dataProvider[i].@name == value) {
						//名前が一致した場合
						dataValue = dataProvider[i].@value;
	                    break;
	                }
	            }
			}

			public function set dataValue(value:String):void{
				if(value != null){
					_value = value;
					if(_value!=""){
						var cname:String;
						
			            var len:int = dataProvider.length;
			            for(var i:int = 0; i < len; i++) {
			                if(dataProvider[i].@value == _value) {
								//ｺｰﾄﾞが一致した場合
			                    cname = dataProvider[i].@name;
			                    break;
			                }
			            }
						_item.@name = cname;
						_item.@value = _value;
						
						selectedItem = _item;
					}
					dispatchEvent(new Event("valueChanged"));                						
				}				
			}
			
			[Bindable(event="valueChanged")]
			public function get dataValue():String{
				return _value;				
			}
				        
			private function onSelectionChange(e:ListEvent):void
			{
				if(selectedItem){
					dataValue = selectedItem.@value;
				}
			}											

			override public function clearMe():void
			{
				dataValue = "";
			}

		]]>
	</mx:Script>
	
</IlsComboBox>
