vaadin – How to add try catch exception inside addValueChangeListener with lambda expression

Good Day !

Title : Vaadin – How to add try catch exception inside addValueChangeListener with lambda expression (java 8)

Example :

// add lambda expression – java 8
s.addValueChangeListener((ValueChangeListener)
(ValueChangeEvent) -> {
           try {
objectsDistrict.addAll(findDistrictSelection((RefState)                                        ValueChangeEvent.getProperty().getValue()));
   } catch (Exception e) {
 // TODO: handle exception

    e.printStackTrace();
                          Notification.show(“Error on Selection Records“,
                        Type.ERROR_MESSAGE);
                       }
 }
});

2) The Above codes are from Source code tutorial – vaadin – How to create a second Combobox which is dependent from the First Combobox.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s