본문 바로가기

컴터/Flash & Flex

flex 내에서 디비쪽으로 변수값 보내기

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
 <mx:HTTPService id="feedRequest" url="http://localhost:8080/flex/get_xml_data.jsp" useProxy="false">
  <mx:request>
   <id>{cb.selectedItem}</id> <!--cb 콤보박스의 선택된값을 id 라는변수에 담아서 보내라-->
  </mx:request>
 </mx:HTTPService>
 
 <mx:Panel title="HttpService" height="100%" width="90%" paddingTop="10" paddingBottom="10" paddingLeft="10"
 paddingRight="10" layout="vertical">
  <mx:DataGrid id="dgPosts" dataProvider="{feedRequest.lastResult.result_set.record}" width="100%" />
 
  <mx:ControlBar horizontalAlign="center">
   <mx:Label text="ID 선택" />
   <mx:ComboBox id="cb" change="feedRequest.send();">
    <mx:ArrayCollection>
     <mx:String>0</mx:String>
     <mx:String>1</mx:String>
     <mx:String>2</mx:String>
     <mx:String>3</mx:String>
     <mx:String>4</mx:String>
     <mx:String>5</mx:String>
    </mx:ArrayCollection>
   </mx:ComboBox>
  </mx:ControlBar>
 </mx:Panel>
</mx:Application>