Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Vaadin 8 (GRID DYNAMIC)

Haroldo Franzin
5 years ago Mar 15, 2017 1:37am
juan carlos montes
5 years ago Mar 17, 2017 5:14pm

DaoGenerico<Object> dao= new DaoGenerico<Object>("data000",Objects.class); 
        List<Map<String, Object>> sql = dao.buscarPorSqlQueryTransformers("SELECT cliente,nombre,dirección FROM clientes where baja ='N'");
        ListDataProvider<Map<String, Object>> lista= new ListDataProvider<Map<String,Object>>(sql);
        Grid<Map<String, Object>> grid= new Grid<Map<String,Object>>();
        grid.setDataProvider(lista);
        grid.addColumn((v)-> v.get("cliente")).setCaption("Cliente");
        grid.addColumn((v)-> v.get("nombre")).setCaption("Nombre");
        grid.addColumn((v)-> v.get("dirección")).setCaption("Dirección");
        layout.addComponents(grid);

Haroldo Franzin
5 years ago Mar 17, 2017 8:19pm