All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.extjs.gxt.ui.client.binding.SimpleComboBoxFieldBinding Maven / Gradle / Ivy

There is a newer version: 2.3.1-gwt22
Show newest version
/*
 * Sencha GXT 2.3.1a - Sencha for GWT
 * Copyright(c) 2007-2013, Sencha, Inc.
 * [email protected]
 * 
 * http://www.sencha.com/products/gxt/license/
 */
 package com.extjs.gxt.ui.client.binding;

import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;

/**
 * A specialized binding that automatically handles data conversion when using a
 * SimpleComboBox.
 */
@SuppressWarnings({"unchecked","rawtypes"})
public class SimpleComboBoxFieldBinding extends FieldBinding {

  protected SimpleComboBox simpleComboBox;

  /**
   * Creates a new simplecombobox field binding instance.
   * 
   * @param field the simple combo box
   * @param property the property name
   */
  public SimpleComboBoxFieldBinding(SimpleComboBox field, String property) {
    super(field, property);
    this.simpleComboBox = field;
  }

  @Override
  protected Object onConvertFieldValue(Object value) {
    return simpleComboBox.getSimpleValue();
  }

  @Override
  protected Object onConvertModelValue(Object value) {
    return simpleComboBox.findModel(value);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy