How to use static method in a Managed Bean to fetch request parameter values

far as I am aware, there is always going to be a DataModel object, but if you associate the dataTable with a raw collection instead of a DataModel wrapping that collection, an anonymous DataModel will be constructed for you. Since it's anonymous, there's no simple clean way to get access to it in order to invoke its getRowData() method. You're not saving anything by doing that unless you are implementing a display-only table (without row-selection), and even then, it's only a small amount of coding time saved, since the actual work of constructing the façade DataModel is done either way.

Note that because the DataModel holds context for data coming and going from the displayed table, it must not be in Request scope.

Back  [1] [2] 

Copyright © 2007-2012 www.chuibin.com Chuibin Copyright