title: Combo with ObservableMap Binding
body: <p>I have a Combo populated using <code>ObservableMap&lt;String, Member&gt;</code>. What I want is if an item(key) is selected in combo, to be able to get corresponding object(value). This is what I have so far</p>
  
  <pre><code>import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.util.HashMap;
  import java.util.logging.Level;
  import javafx.application.Application;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.collections.ObservableMap;
  import javafx.scene.Scene;
  import javafx.scene.control.ComboBox;
  import javafx.scene.layout.BorderPane;
  import javafx.stage.Stage;
  import org.controlsfx.control.textfield.TextFields;
  
  public class ComboWithHashMap extends Application{
      private ComboBox autocompleteCombo = new ComboBox();
      private ObservableMap&lt;String, Member&gt; list;
  
      public static void main(String[] args) {
         launch(args);
      }
  
      @Override
      public void start(Stage primaryStage) throws Exception {
          primaryStage.setTitle("Combo Sample");
          primaryStage.setWidth(450);
          primaryStage.setHeight(550);
  
          list = FXCollections.observableMap(getActiveMember());
          autocompleteCombo.getItems().setAll(list.keySet());
          //TextFields.bindAutoCompletion(autocompleteCombo.getEditor(), autocompleteCombo.getItems());
          Scene scene = new Scene(new BorderPane(autocompleteCombo), 880, 600);
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
  
      public HashMap&lt;String, Member&gt; getActiveMember(){
          HashMap&lt;String, Member&gt; map = new HashMap&lt;String, Member&gt;();
          Member member1 = new Member(1, "123", "John Doe");
          Member member2 = new Member(2, "234", "Sally Doe");
          Member member3 = new Member(3, "345", "Billy Doe");
          Member member4 = new Member(4, "567", "Mac Doe");
          Member member5 = new Member(5, "789", "Win Doe");
  
          map.put( member1.getMilkNo(), member1);
          map.put( member2.getMilkNo(), member2);
          map.put( member3.getMilkNo(), member3);
  
          return map;
      }
  
      public class Member {
          private int id;
          private String milkNo;
          private String fullName;
  
          public Member(int id, String milkNo, String fullName) {
              this.id = id;
              this.milkNo = milkNo;
              this.fullName = fullName;
          }
  
          public int getId() {
              return id;
          }
  
          public void setId(int id) {
              this.id = id;
          }
  
  
          public String getMilkNo() {
              return milkNo;
          }
  
          public void setMilkNo(String milkNo) {
              this.milkNo = milkNo;
          }
  
          @Override
          public String toString() {
              return fullName;
          }
  
      }
  
  }
  </code></pre>
  
  <p>The problem is so far I cannot get the corresponding object(value) when a key is selected.</p>