2 Replies Latest reply on Dec 15, 2010 1:04 AM by paolo.anghileri

    Name-value pairs in item editor

    paolo.anghileri

      I am setting up a datagrid that must have in some fields an itemEditor displaying a combobox with name/value pairs:

       

          <mx:DataGrid height="100%" width="100%" id="dgTaxa" editable="true">
                              <mx:columns>
                                  <mx:DataGridColumn headerText="Codice" dataField="taxonCode" width="60"/>
                                  <mx:DataGridColumn id="colFamily" headerText="Famiglia" dataField="family" width="80">
                                      <mx:itemEditor>
                                          <fx:Component>
                                             
                                              <mx:ComboBox width="80" labelField="familyId" dataProvider="{parentDocument.families}" >
                                             
                                              </mx:ComboBox>
                                          </fx:Component>
                                                 
                                      </mx:itemEditor>
                                  </mx:DataGridColumn>                           
                              </mx:columns>
                          </mx:DataGrid>

       

      This combobox has a dataprovider that it's this one:

       

      [Bindable]
      public var families:ArrayCollection = new ArrayCollection([
              { familyId:1, name:"cactacee"},
              { familyId:2, name:"liliacee"}
          ]);

       

      My problem is that I want to show name as combobox labels, but get familyId as combobox values to send back to the webservice.

       

      Does anyone know how to help me?

       

      Thanks

       

      Paolo