Breadcrumb Breadcrumb
Community Links Community Links
Javadoc Links Javadoc Links
Community Forums Community Forums
Combination View Flat View Tree View
Threads [ Previous | Next ]
LazyDataModel - where is the search() method ?
toggle
Neil, anyone ...

Based upon your guidance I have used LazyDataModel with ice DataTable
http://blog.icefaces.org/blojsom/blog/default/Neil%20Griffin/

I have search text box, search button and table that lazy loads search results which are between 1 and million. all works fine.

When user hits search I call clearCache() function from LazyDataModel. Is that correct, somehow name is not re-ensuring me that I make a right call.

Thanks,
P.

PS:
public void clearCache() {
setRowCount(-1);
setWrappedData(null);
setWrappedDataBeginRowIndex(-1);
setWrappedDataEndRowIndex(-1);
setRowMarks(null);
}
Flag Flag
RE: LazyDataModel - where is the search() method ?
7/9/10 7:56 PM as a reply to Petar Banicevic.
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 }
Flag Flag
RE: LazyDataModel - where is the search() method ?
7/9/10 11:56 PM as a reply to Neil Griffin.
our small IBM team thanks you emoticon
Flag Flag