Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vaadin : Filtering output on the table

im new in java component base framework, especially vaadin. before use this framework, im using struts 2.

so when i want to query some table, i have a search box, contains many textfield. when user click Search Button, then the parameters from the texfield will be sent into my hibernate directly using http post.

my question, how to filter the output using vaadin?

like image 790
Diaz Pradiananto Avatar asked Jan 19 '26 06:01

Diaz Pradiananto


1 Answers

Just update your BeanContainer with new data. Here is an example of my code

public void refreshTableData() {
    getBeanContainer().removeAllItems();
    List<Customer> customers = customerDao.getByCustomerFilter(getCustomerFilterForm().getFilterItem().getBean());
    getBeanContainer().addAll(customers);
}

Where CustomerFilter is a bean that has all the search criteria data, that I fill it within a form earlier (e.g with comboboxes), and beanContainer is my table container data source.

like image 85
eugen-fried Avatar answered Jan 20 '26 18:01

eugen-fried