Pass in parameter from ComboBox to WebService : ComboBox « Components « Flex






Pass in parameter from ComboBox to WebService

Pass in parameter from ComboBox to WebService
        


<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="10">
  <mx:Script>
    
    import mx.utils.ArrayUtil;
  </mx:Script>
  <mx:WebService id="employeeWS" destination="wsDest"  fault="mx.controls.Alert.show(event.fault.faultString)">
    <mx:operation name="getList">
      <mx:request>
        <deptId>{dept.selectedItem.data}</deptId>
      </mx:request>
    </mx:operation>
  </mx:WebService>
  <mx:ArrayCollection id="employeeAC"  source="{ArrayUtil.toArray(employeeWS.getList.lastResult)}" />
  <mx:HBox>
    <mx:ComboBox id="dept" width="150">
      <mx:dataProvider>
        <mx:ArrayCollection>
          <mx:source>
            <mx:Object label="A" data="A para" />
            <mx:Object label="B" data="B para" />
            <mx:Object label="C" data="C para" />
          </mx:source>
        </mx:ArrayCollection>
      </mx:dataProvider>
    </mx:ComboBox>
    <mx:Button label="Get" click="employeeWS.getList.send()" />
  </mx:HBox>
  <mx:DataGrid dataProvider="{employeeAC}" width="100%">
    <mx:columns>
      <mx:DataGridColumn dataField="name" headerText="Name" />
      <mx:DataGridColumn dataField="phone" headerText="Phone" />
      <mx:DataGridColumn dataField=" to email" headerText="Email" />
    </mx:columns>
  </mx:DataGrid>
</mx:Application>

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.ComboBox open/close easing functionComboBox open/close easing function
2.Create ComboBox with static objectsCreate ComboBox with static objects
3.Populating a ComboBox control using variablesPopulating a ComboBox control using variables
4.ComboBox-based custom componentComboBox-based custom component
5.extends the standard ComboBox control to initialize itextends the standard ComboBox control to initialize it
6.Sort ComboBox
7.Insert value to ComboBox through CursorInsert value to ComboBox through Cursor
8.Set row count for ComboBoxSet row count for ComboBox
9.Use labelFunction to provide label text for ComboBoxUse labelFunction to provide label text for ComboBox
10.Bind Image source to ComboBox
11.Editable ComboBoxEditable ComboBox
12.Bind ComboBox and TextInput and TextBind ComboBox and TextInput and Text
13.Static ComboBoxStatic ComboBox
14.ComboBox with static String valuesComboBox with static String values
15.Simple ComboBoxSimple ComboBox
16.ComboBox component supports a closeEasingFunction style property.ComboBox component supports a closeEasingFunction style property.
17.Uses the bound propertyUses the bound property
18.Set a labelFunction for a ControlSet a labelFunction for a Control