Vaadin 8 Grid issue

Good evening,

I am having a serious issue with grid data. The first time grid loads properly. When i search the next customer grid data doesn’t change.
I displayed the
and i noticed the new data being populated in the list however I am not able to paint the new grid but the page refresh works just fine.

Please help !!!


public void [b]

[/b](String key) {
System.out.println(“CustomerService() - BuildUI”);
HorizontalLayout topLayout = createTopBar();

    grid = new CustomerGrid();

    VerticalLayout barAndGridLayout = new VerticalLayout();
    barAndGridLayout.setExpandRatio(grid, 1);

public void updateList() {
    System.out.println("CustomerService() - updateList");
    List<Customer> customers = null;
    CustomerService service = CustomerService.getInstance(key);
    customers = service.findAll(filter.getValue());
    System.out.println(customers.toString());   <== This display shows the newly fetched data.


At least this code snippet doesn’t show anything immediately wrong. Can you share your CustomerGrid implementation as well?


Attahced are and files. (8.7 KB) (4.07 KB)

Thanks Olli, here is my code. Also, I attached the file for your reference.

package com.sunpower.infolease.customer;

import com.vaadin.ui.Grid;
import com.vaadin.ui.renderers.NumberRenderer;


  • Grid of products, handling the visual presentation and filtering of a set of

  • items. This version uses an in-memory data source that is suitable for small

  • data sets.
    public class CustomerGrid extends Grid {

    private static final long serialVersionUID = 1L;

    public CustomerGrid() {

     addColumn(Customer::getCcan, new NumberRenderer()).setCaption("CCAN");
     addColumn(Customer::getName).setCaption("Customer Name");
     addColumn(Customer::getEmail).setCaption("Email ID");


    public Customer getSelectedRow() {
    return asSingleSelect().getValue();

    public void refresh(Customer product) {


package com.sunpower.infolease.customer;


public class Customer implements Serializable, Cloneable {

private static final long serialVersionUID = 1L;

private long ccan;
private String name    = "";
private String address = "";
private String phone   = "";
private String email   = "";

public Customer(long ccan, String name, String email, String phone, String address) {
     this.ccan    = ccan;    = name;   = email;   = phone;
     this.address = address;

public Customer() {
    // TODO Auto-generated constructor stub

public long getCcan() {
    return ccan;

public void setCcan(long ccan) {
    this.ccan = ccan;

public String getEmail() {
    return email;

public void setEmail(String email) { = email;

public String getPhone() {
    return phone;

public void setPhone(String phone) { = phone;

public String getAddress() {
    return address;

public void setAddress(String address) {
    this.address = address;

public String getName() {
    return name;

public void setName(String name) { = name;

public Customer clone() throws CloneNotSupportedException {
    return (Customer) super.clone();

public String toString() {
    return "Customer:: ID="+this.ccan+" Name=" + + " phone=" + + " email=" + this.address + " address=" + this.address;


One way to updae the content of the Grid via DataProvider is by adding/removing items in underlying collection and applying refreshAll() method of the DataProvider.

Hi Srini,

I tested your app out (as much as I could) and looks like the problem is in your backend or the CustomerService. I don’t know the details, but after modifying the code to work without the real backend, I was able to update my CustomerGrid with new (randomly generated) entries whenever the ValueChangeEvent of the filter TextField fires. So the Vaadin code seems to work ok.