Perfectly, I was updated vaadin to version 6.2.2 and now the table is filled according to a container configuration.
Actually, so I receive the container -
JDBCConnectionPool connectionPool = null;
try {
connectionPool = new SimpleJDBCConnectionPool(
"oracle.jdbc.OracleDriver",
"jdbc:oracle:thin:@gissde:1522:EF", "....", "....", 2, 5);
} catch (SQLException e) {
e.printStackTrace();
}
FreeformQuery query = new FreeformQuery(
" SELECT Lookup_Val_id, " +
" LOOKUP_VAL_CODE, " +
" LOOKUP_VAL_NAME " +
" FROM Rz_Lookup_Vals " +
" WHERE ID_Var=2 AND Lookup_Val_id<>100",
connectionPool,
"Lookup_Val_id"
);
SQLContainer container = null;
try {
container = new SQLContainer(query);
} catch (SQLException e) {
e.printStackTrace();
}
And so i set it as a source of the data for the table:
Table table = new Table(null, container);
table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
table.setContainerDataSource(container);
However the following code to achieve functional a component
instant text field
doesn’t allow:
...
TextField filterField = new TextField("Filter");
filterField.setTextChangeEventMode(TextChangeEventMode.LAZY);
filterField.setTextChangeTimeout(200);
filterField.addListener(new filterFieldListener(container));
...
class filterFieldListener implements TextChangeListener {
private SQLContainer container;
filterFieldListener(SQLContainer container) {
this.container = container;
}
public void textChange(TextChangeEvent event) {
// TODO Auto-generated method stub
container.removeAllContainerFilters();
container.addContainerFilter(new Like("LOOKUP_VAL_NAME", event.getText()+"%"));
}
}
In other words, the filter doesn’t work how it would be desirable by analogy to this example - http://demo.vaadin.com/sampler#TextFieldTextChangeEvent