com.extjs.gxt.ui.client.binding.SimpleComboBoxFieldBinding Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gxt Show documentation
Show all versions of gxt Show documentation
Rich Internet Application Framework for GWT
/*
* 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);
}
}