I am very new to vaadin (and to java).
I have a table that has SQLcontainer:
public class ProjectTable extends Table {
public ProjectTable(final DocumentmanagerApplication app) {
setSizeFull();
setContainerDataSource(app.getDbHelp().getProjectContainer());
setImmediate(true);
commit();
setSelectable(true);
}
}
I have a button and TextField to populate data in a table
public void buttonClick(ClickEvent event)
{
SQLContainer cont = h.getAssetContainer();
String dataResult = tf.getValue().toString();
System.out.println(dataResult);
Object itemId = cont.addItem();
**cont.getContainerProperty(itemId , "id").setValue(dataResult);
try {
cont.commit();
} catch (UnsupportedOperationException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
I keep getting a “null pointer exception” no matter what I do. on the string ** cont.getContainerProperty (itemId, "id"). setValue (dataResult);
Am I doing something wrong? and what is a null pointer?
let me know if something is unclear.
Please help, thanks in advance.
source
share