*/
if (propertyId.equals("secondaryTypes")) {
return getSecondaryTypesList(itemId);
}
final Field f = super.createField(container, itemId, propertyId,
uiContext);
if (f != null) {
if (f instanceof TextField) {
TextField tf = (TextField) f;
tf.setWidth("100%");
}
if (propertyId.equals("kilometers")) {
f.setWidth("4em");
f.addValidator(new Validator() {
@Override
public void validate(Object value)
throws InvalidValueException {
// FIXME this does not follow the standard pattern
// for validators and has side effects!
try {
@SuppressWarnings("unused")
float f = Float.parseFloat((String) value);
} catch (Exception e) {
Notification.show("Bad number value");
f.setValue(0);
}
}
});
}
if (propertyId.equals("date")) {