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

de.mhus.lib.vaadin.form2.UiDate Maven / Gradle / Ivy

There is a newer version: 3.2.8
Show newest version
package de.mhus.lib.vaadin.form2;

import java.util.Date;

import com.vaadin.ui.AbstractField;
import com.vaadin.ui.DateField;

import de.mhus.lib.errors.MException;
import de.mhus.lib.form.DataConnector;

public class UiDate extends UiText {

	

	@Override
	protected AbstractField createTextField() {
		return new DateField();
	}
	
	@Override
	protected void setValueToDataSource(DataConnector data) throws MException {
		data.setDate((Date)field.getValue());
	}
	
	@Override
	protected Object getValueFromDataSource(DataConnector data) {
		return data.getDate(null);
	}
	
	@Override
	protected void setValueToField(Object arg) {
		try {
			super.setValueToField(arg);
		} catch (Throwable t) {
			super.setValueToField(null);
		}
	}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy