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.

Table.addItem()

Champollion Viana
6 years ago May 26, 2015 8:34pm
Marko Grönroos
6 years ago May 26, 2015 9:51pm
Champollion Viana
6 years ago May 27, 2015 12:34pm
Marko Grönroos
6 years ago May 27, 2015 12:37pm
Champollion Viana
6 years ago May 27, 2015 12:55pm
Champollion Viana
6 years ago May 27, 2015 1:03pm

Marko ?

Thank you for solving the problem.

I change this :

Long cont = 0L;
while(rs.next()) {
              
   Object itemId = tableProdutos.addItem(rs.getLong("ID_Produto"));
   Item row = tableProdutos.getItem(itemId);
   row.getItemProperty("ORDEM").setValue(++cont); // Here : NullPointerException
   row.getItemProperty("CÓD. EXTERNO").setValue(Long.valueOf(rs.getString("CodExterno")));
   row.getItemProperty("DESCRIÇÃO").setValue(rs.getString("Descricao"));
   row.getItemProperty("ESTOQUE").setValue(rs.getDouble("Estoq"));
}

to this :

long cont = 0;
            
while(rs.next()) {
                
   cont++;
                
   Item itemId = tableProdutos.addItem(rs.getLong("ID_Produto"));
   itemId.getItemProperty("ORDEM").setValue(cont);
   itemId.getItemProperty("CÓD. EXTERNO").setValue(Long.valueOf(rs.getString("CodExterno")));
   itemId.getItemProperty("DESCRIÇÃO").setValue(rs.getString("Descricao"));
   itemId.getItemProperty("ESTOQUE").setValue(rs.getDouble("Estoq"));
                
}                
                
   

Thank you very much !
 

Marko Grönroos
6 years ago May 27, 2015 1:43pm
Champollion Viana
6 years ago May 27, 2015 1:53pm