Normally I have a JSF managed-bean like this:
1
2public class MyManagedBean {
3
4 private String searchCriteria;
5 private DataModel dataModel;
6
7 // Bound via EL to an ice:dataTable
8 public DataModel getDataModel() {
9 if (dataModel == null) {
10 dataModel = new MyLazyDataModel(searchCriteria);
11 }
12 }
13
14 // Bound via EL to an ice:inputText
15 public String getSearchCriteria() {
16 return searchCriteria;
17 }
18
19 // Bound via EL to an ice:inputText
20 public void setSearchCriteria(String searchCriteria) {
21 this.searchCriteria = searchCriteria;
22 }
23
24 // Gets called when the user clicks the Search button
25 public void searchButtonActionListener(ActionEvent actionEvent) {
26 // Nullify the dataModel, which will cause the getDataModel() method
27 // to create a new MyLazyDataModel when the RENDER_RESPONSE
28 // phase of the JSF lifecycle executes.
29 this.dataModel = null;
30 }
31 }