Vaadin PopupDateField is unable to set the default value if we use bind met

I have a Bean Class(Java Pojo) and the Search Panel(Vaadin Code) class as mentioned below.

  1. In Search Panel class by using the PopupDateField i am creating the DateField(Date Picker) and setting the default value to the dateField.Upto now it is working fine but the dateField is unable to bind to the property (fromDate)of the Bean class (SearchVo class).

2)For that i have used the bind(Field(?),Property) method for the above problem, Now i am able to bind the fromdate to the bean class but unable to set the default value and unable to access the default value from the DatePicker to the Code.

Can any one help me to set the default value to the dateField and able to access the value from the DatePicker to the Code.

Thank you in advanceā€¦

SearchVo Bean Class:

public class SearchVO {

private String origin;
private Date fromDate;
private Date toDate;

public Date getFromDate() {
return fromDate;

public void setFromDate(Date fromDate) {
this.fromDate = fromDate;

public Date getToDate() {
return toDate;

public void setToDate(Date toDate) {
this.toDate = toDate;
public String getOrigin() {
return origin;

public void setOrigin(String origin) {
this.origin = origin;


Serach Panel Class:

public class SearchPanel extends HorizontalLayout {

FieldGroup group;
SearchVO searchVO;
BaseView baseView;

public SearchPanel(BaseView baseView) {


private Component getRightPanel() {

SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
java.util.Calendar calendar =  java.util.Calendar.getInstance();
java.util.Calendar calendar1 =  java.util.Calendar.getInstance();

calendar.add(java.util.Calendar.DATE, -2);
calendar1.add(java.util.Calendar.DATE, 2);

PopupDateField fromDate = new PopupDateField("fromDate");

PopupDateField toDate = new PopupDateField("toDate");

/*Field<?> fromDate = group.buildAndBind("fromDate");
Field<?> toDate = group.buildAndBind("toDate");*/
Field<?> departure = group.buildAndBind("", "departureArrival", OptionGroup.class);
Button search = new Button("Search");
search.addClickListener(new Button.ClickListener() {
    public void buttonClick(Button.ClickEvent clickEvent) {
        try {
            //UI.getCurrent().getSession().setAttribute("search", searchVO);
        catch (FieldGroup.CommitException e) {