我是 Java 组件基础框架中的新成员,尤其是 vaadin。 在使用这个框架之前,我使用的是 struts 2。
所以当我想查询一些表格时,我有一个搜索框,包含许多文本字段。当用户单击搜索按钮时,来自 texfield 的参数将使用 http post 直接发送到我的 hibernate 中。
我的问题是,如何使用 vaadin 过滤输出?
最佳答案
只需用新数据更新您的 BeanContainer。这是我的代码示例
public void refreshTableData() {
getBeanContainer().removeAllItems();
List<Customer> customers = customerDao.getByCustomerFilter(getCustomerFilterForm().getFilterItem().getBean());
getBeanContainer().addAll(customers);
}
CustomerFilter 是一个包含所有搜索条件数据的 bean,我之前将其填充到一个表单中(例如使用组合框),而 beanContainer 是我的表容器数据源。
关于java - 瓦丁 : Filtering output on the table,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13449887/